summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2017-06-19 13:54:59 -0400
committerjacobkeeler <jacob.keeler@livioradio.com>2017-06-20 17:01:41 -0400
commit5ad613ffbd9666da28130e0ed7b76a4277a29cc2 (patch)
tree4688757dc0275dbda8ec5a3b617cf1b063c1ae14
parent0fdd32f58dbedf7e175d5ab8b3e04b4edd3d9526 (diff)
parent22a014b3746b28d2b8a3a4049c60bb76db6a0861 (diff)
downloadsdl_core-coverity.tar.gz
Merge branch 'develop'coverity
-rw-r--r--.clang-format4
-rw-r--r--.gitignore6
-rw-r--r--.travis.yml26
-rw-r--r--CMakeLists.txt510
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--Doxyfile2438
-rw-r--r--LICENSE6
-rw-r--r--README.md12
-rw-r--r--cmake/Modules/FindSqlite3.cmake81
-rw-r--r--docs/FORD.OpenSDL.SDD.TPL.dox355
-rw-r--r--docs/mainpage.dox11
-rw-r--r--src/3rd_party-static/CMakeLists.txt7
-rw-r--r--src/3rd_party-static/MessageBroker/CMakeLists.txt39
-rw-r--r--src/3rd_party-static/encryption/CMakeLists.txt39
-rw-r--r--src/3rd_party-static/gmock-1.7.0/include/gmock/gmock-spec-builders.h12
-rw-r--r--src/3rd_party-static/gmock-1.7.0/src/gmock-spec-builders.cc102
-rw-r--r--src/3rd_party-static/jsoncpp/CMakeLists.txt44
-rw-r--r--src/3rd_party-static/message_broker/CMakeLists.txt78
-rw-r--r--src/3rd_party-static/message_broker/include/CMessageBroker.hpp (renamed from src/3rd_party-static/MessageBroker/include/CMessageBroker.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/include/CMessageBrokerRegistry.hpp (renamed from src/3rd_party-static/MessageBroker/include/CMessageBrokerRegistry.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/include/CSender.hpp (renamed from src/3rd_party-static/MessageBroker/include/CSender.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/include/MBDebugHelper.h (renamed from src/3rd_party-static/MessageBroker/include/MBDebugHelper.h)0
-rw-r--r--src/3rd_party-static/message_broker/include/mb_client.hpp (renamed from src/3rd_party-static/MessageBroker/include/mb_client.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/include/mb_controller.hpp (renamed from src/3rd_party-static/MessageBroker/include/mb_controller.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/include/mb_server.hpp (renamed from src/3rd_party-static/MessageBroker/include/mb_server.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/include/mb_tcpclient.hpp (renamed from src/3rd_party-static/MessageBroker/include/mb_tcpclient.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/include/mb_tcpserver.hpp (renamed from src/3rd_party-static/MessageBroker/include/mb_tcpserver.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/include/networking.h (renamed from src/3rd_party-static/MessageBroker/include/networking.h)0
-rw-r--r--src/3rd_party-static/message_broker/include/system.h (renamed from src/3rd_party-static/MessageBroker/include/system.h)0
-rw-r--r--src/3rd_party-static/message_broker/include/websocket_handler.hpp (renamed from src/3rd_party-static/MessageBroker/include/websocket_handler.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/client/mb_client.cpp (renamed from src/3rd_party-static/MessageBroker/src/client/mb_client.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/client/mb_controller.cpp (renamed from src/3rd_party-static/MessageBroker/src/client/mb_controller.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/client/mb_tcpclient.cpp (renamed from src/3rd_party-static/MessageBroker/src/client/mb_tcpclient.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.cpp (renamed from src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerAVA.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.hpp (renamed from src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerAVA.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.cpp (renamed from src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerBackend.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.hpp (renamed from src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerBackend.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.cpp (renamed from src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerPhone.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.hpp (renamed from src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerPhone.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerServer.cpp (renamed from src/3rd_party-static/MessageBroker/src/example/MessageBrokerServer.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerServer.hpp (renamed from src/3rd_party-static/MessageBroker/src/example/MessageBrokerServer.hpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp (renamed from src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBroker.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp (renamed from src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBrokerRegistry.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/libMBDebugHelper.h (renamed from src/3rd_party-static/MessageBroker/src/lib_messagebroker/libMBDebugHelper.h)0
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/md5.cpp (renamed from src/3rd_party-static/MessageBroker/src/lib_messagebroker/md5.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/md5.h (renamed from src/3rd_party-static/MessageBroker/src/lib_messagebroker/md5.h)0
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/system.cpp (renamed from src/3rd_party-static/MessageBroker/src/lib_messagebroker/system.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp (renamed from src/3rd_party-static/MessageBroker/src/lib_messagebroker/websocket_handler.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/server/mb_server.cpp (renamed from src/3rd_party-static/MessageBroker/src/server/mb_server.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp (renamed from src/3rd_party-static/MessageBroker/src/server/mb_tcpserver.cpp)0
-rw-r--r--src/3rd_party-static/message_broker/src/server/networking.cpp (renamed from src/3rd_party-static/MessageBroker/src/server/networking.cpp)0
-rw-r--r--src/3rd_party-static/test/CMakeLists.txt15
-rw-r--r--src/3rd_party/CMakeLists.txt231
-rw-r--r--src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt2
-rw-r--r--src/appMain/CMakeLists.txt147
-rwxr-xr-xsrc/appMain/hmi_capabilities.json2
-rw-r--r--src/appMain/life_cycle.cc19
-rw-r--r--src/appMain/life_cycle.h3
-rw-r--r--src/appMain/main.cc13
-rw-r--r--src/appMain/sample_policy_manager.py123
-rw-r--r--src/appMain/sdl_preloaded_pt.json19
-rw-r--r--src/appMain/smartDeviceLink.ini17
-rw-r--r--src/appMain/start.sh2
-rw-r--r--src/appMain/start_external_proprietary.sh21
-rw-r--r--src/components/CMakeLists.txt57
-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.txt596
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h74
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h86
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data.h103
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h168
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h136
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h156
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_sql_queries.h51
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/apps_launcher.h86
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h46
-rw-r--r--src/components/application_manager/include/application_manager/application.h30
-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.h11
-rw-r--r--src/components/application_manager/include/application_manager/application_manager.h580
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h145
-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.h6
-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.h124
-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_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.h12
-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_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.h6
-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/request_from_hmi.h33
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h21
-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/tts_is_ready_request.h20
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h20
-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_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_is_ready_request.h20
-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_is_ready_request.h21
-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.h29
-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.h6
-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.h19
-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.h23
-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.h29
-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.h27
-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.h19
-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.h6
-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.h20
-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_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.h46
-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.h45
-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.h17
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h12
-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.h13
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h20
-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/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/hmi_capabilities.h605
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities_impl.h496
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces.h102
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces_impl.h77
-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.h6
-rw-r--r--src/components/application_manager/include/application_manager/message.h2
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h58
-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.h246
-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.h48
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h84
-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.h369
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h500
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data.h1
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_db.h4
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h6
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h32
-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_ctrl_impl.cc116
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_db.cc396
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_impl.cc83
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_json.cc282
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_sql_queries.cc78
-rw-r--r--src/components/application_manager/src/app_launch/apps_launcher.cc139
-rw-r--r--src/components/application_manager/src/app_launch/device_apps_launcher.cc208
-rw-r--r--src/components/application_manager/src/application_impl.cc21
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc196
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc382
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_request.cc1
-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.cc166
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc26
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc6
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc30
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc13
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc28
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc6
-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_exit_application_notification.cc17
-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.cc7
-rw-r--r--src/components/application_manager/src/commands/hmi/request_from_hmi.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/request_to_hmi.cc24
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc70
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc12
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc12
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc5
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc14
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc12
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_request.cc120
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc20
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc118
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_request.cc117
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_request.cc171
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc123
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_request.cc93
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_request.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc20
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc17
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc19
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_request.cc15
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc30
-rw-r--r--src/components/application_manager/src/commands/mobile/get_way_points_request.cc18
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_event_notification.cc14
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_press_notification.cc25
-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_permissions_change_notification.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/on_system_request_notification.cc28
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc161
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_request.cc200
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_request.cc20
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc318
-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.cc91
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_request.cc26
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_request.cc34
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_request.cc21
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_request.cc18
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_request.cc91
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc18
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc29
-rw-r--r--src/components/application_manager/src/commands/mobile/show_request.cc18
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_request.cc9
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_request.cc14
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_request.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc255
-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.cc10
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc12
-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.cc48
-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.cc17
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_request.cc21
-rw-r--r--src/components/application_manager/src/hmi_capabilities.cc950
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc1106
-rw-r--r--src/components/application_manager/src/hmi_command_factory.cc17
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc268
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc15
-rw-r--r--src/components/application_manager/src/hmi_state.cc2
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc390
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc97
-rw-r--r--src/components/application_manager/src/policies/delegates/app_permission_delegate.cc18
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc1
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc887
-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.cc163
-rw-r--r--src/components/application_manager/src/request_info.cc65
-rw-r--r--src/components/application_manager/src/request_tracker.cc133
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl.cc795
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc815
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc9
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc29
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc4
-rw-r--r--src/components/application_manager/src/usage_statistics.cc14
-rw-r--r--src/components/application_manager/test/CMakeLists.txt205
-rw-r--r--src/components/application_manager/test/app_launch/CMakeLists.txt62
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc371
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_db_test.cc345
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_json_test.cc344
-rw-r--r--src/components/application_manager/test/application_impl_test.cc48
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc200
-rw-r--r--src/components/application_manager/test/commands/CMakeLists.txt67
-rw-r--r--src/components/application_manager/test/commands/command_impl_test.cc281
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc521
-rw-r--r--src/components/application_manager/test/commands/command_response_impl_test.cc186
-rw-r--r--src/components/application_manager/test/commands/hmi/activate_app_request_test.cc118
-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.cc159
-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.cc1942
-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.cc123
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc141
-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_start_stream_request_test.cc123
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc105
-rw-r--r--src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc120
-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.cc507
-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.cc174
-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.cc280
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc368
-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.cc223
-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.cc211
-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.cc177
-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.cc195
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc79
-rw-r--r--src/components/application_manager/test/commands/mobile/add_command_request_test.cc1115
-rw-r--r--src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc140
-rw-r--r--src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc279
-rw-r--r--src/components/application_manager/test/commands/mobile/alert_request_test.cc814
-rw-r--r--src/components/application_manager/test/commands/mobile/change_registration_test.cc546
-rw-r--r--src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc827
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_command_request_test.cc265
-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.cc275
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc349
-rw-r--r--src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc199
-rw-r--r--src/components/application_manager/test/commands/mobile/dial_number_request_test.cc187
-rw-r--r--src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc342
-rw-r--r--src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc134
-rw-r--r--src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc140
-rw-r--r--src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc270
-rw-r--r--src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc294
-rw-r--r--src/components/application_manager/test/commands/mobile/list_files_request_test.cc130
-rw-r--r--src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc355
-rw-r--r--src/components/application_manager/test/commands/mobile/on_command_notification_test.cc137
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc128
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc280
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc215
-rw-r--r--src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc175
-rw-r--r--src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc217
-rw-r--r--src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc140
-rw-r--r--src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc137
-rw-r--r--src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc148
-rw-r--r--src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc116
-rw-r--r--src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc788
-rw-r--r--src/components/application_manager/test/commands/mobile/perform_interaction_test.cc278
-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.cc170
-rw-r--r--src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc366
-rw-r--r--src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc412
-rw-r--r--src/components/application_manager/test/commands/mobile/scrollable_message_test.cc319
-rw-r--r--src/components/application_manager/test/commands/mobile/send_location_request_test.cc399
-rw-r--r--src/components/application_manager/test/commands/mobile/set_app_icon_test.cc168
-rw-r--r--src/components/application_manager/test/commands/mobile/set_display_layout_test.cc272
-rw-r--r--src/components/application_manager/test/commands/mobile/set_global_properties_test.cc1254
-rw-r--r--src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc367
-rw-r--r--src/components/application_manager/test/commands/mobile/show_test.cc812
-rw-r--r--src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc115
-rw-r--r--src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc199
-rw-r--r--src/components/application_manager/test/commands/mobile/slider_test.cc368
-rw-r--r--src/components/application_manager/test/commands/mobile/speak_request_test.cc420
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc204
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc32
-rw-r--r--src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc118
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc105
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc293
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc111
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc142
-rw-r--r--src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc313
-rw-r--r--src/components/application_manager/test/event_engine_test.cc5
-rw-r--r--src/components/application_manager/test/hmi_capabilities.json16
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc166
-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.h129
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/commands_test.h186
-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/hmi_capabilities_for_testing.h14
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_app_launch_ctrl.h47
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_app_launch_data.h57
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h11
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application_manager.h248
-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.h180
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_interface.h56
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h107
-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.h104
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h2
-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.txt9
-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.cc174
-rw-r--r--src/components/application_manager/test/mobile_message_handler_test.cc33
-rw-r--r--src/components/application_manager/test/mobile_message_handler_v1_test.cc12
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc177
-rw-r--r--src/components/application_manager/test/policy_event_observer_test.cc5
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc1260
-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.cc504
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc6
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc12
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc2
-rw-r--r--src/components/application_manager/test/smartDeviceLink_test.ini16
-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.cc532
-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.h83
-rw-r--r--src/components/config_profile/src/profile.cc154
-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/config_profile/test/smartDeviceLink.ini16
-rw-r--r--src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini16
-rw-r--r--src/components/config_profile/test/smartDeviceLink_invalid_int.ini16
-rw-r--r--src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini16
-rw-r--r--src/components/config_profile/test/smartDeviceLink_invalid_string.ini16
-rw-r--r--src/components/config_profile/test/smartDeviceLink_test.ini16
-rw-r--r--src/components/connection_handler/CMakeLists.txt32
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler.h197
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h14
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_observer.h120
-rw-r--r--src/components/connection_handler/include/connection_handler/heartbeat_monitor.h6
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc15
-rw-r--r--src/components/connection_handler/test/CMakeLists.txt20
-rw-r--r--src/components/connection_handler/test/connection_handler_impl_test.cc221
-rw-r--r--src/components/connection_handler/test/connection_test.cc2
-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.txt29
-rw-r--r--src/components/dbus/include/dbus/dbus_adapter.h2
-rw-r--r--src/components/dbus/include/dbus/dbus_message.h6
-rw-r--r--src/components/dbus/include/dbus/dbus_message_controller.h3
-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.cc2
-rw-r--r--src/components/dbus/test/CMakeLists.txt19
-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.cc (renamed from src/components/dbus/test/test_dbus_message_controller.cc)0
-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/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/formatter_json_rpc_test.cc4
-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.cc2
-rw-r--r--src/components/formatters/test/src/create_smartSchema.cc3
-rw-r--r--src/components/formatters/test/src/meta_formatter_test_helper.cc1
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt38
-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_handler.h63
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h8
-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/mqueue_adapter.h66
-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.cc4
-rw-r--r--src/components/hmi_message_handler/src/hmi_message_handler_impl.cc2
-rw-r--r--src/components/hmi_message_handler/src/mqueue_adapter.cc144
-rw-r--r--src/components/hmi_message_handler/test/CMakeLists.txt35
-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_handler_impl_test.cc73
-rw-r--r--src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h14
-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.h10
-rw-r--r--src/components/hmi_message_handler/test/mock_subscriber.cc13
-rw-r--r--src/components/hmi_message_handler/test/mqueue_adapter_test.cc94
-rw-r--r--src/components/include/application_manager/app_launch_settings.h22
-rw-r--r--src/components/include/application_manager/application_manager.h597
-rw-r--r--src/components/include/application_manager/application_manager_settings.h11
-rw-r--r--src/components/include/application_manager/hmi_capabilities.h442
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h108
-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/application_manager/vehicle_info_data.h71
-rw-r--r--src/components/include/connection_handler/connection_handler.h209
-rw-r--r--src/components/include/connection_handler/connection_handler_observer.h120
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_adapter.h60
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_handler.h63
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_observer.h53
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_sender.h47
-rw-r--r--src/components/include/media_manager/media_manager.h68
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h140
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h569
-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.h86
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h521
-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/statistics_manager.h86
-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.h86
-rw-r--r--src/components/include/protocol_handler/telemetry_observer.h57
-rw-r--r--src/components/include/security_manager/crypto_manager.h2
-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.h60
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h266
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h13
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h66
-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.h2
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_observer.h69
-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.h6
-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_policy_listener.h101
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h204
-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_policy_manager.h213
-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_observer.h57
-rw-r--r--src/components/include/test/protocol_handler/mock_session_observer.h6
-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/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.h3
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_listener.h90
-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.h6
-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.h109
-rw-r--r--src/components/include/test/utils/test_async_waiter.h104
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h12
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h14
-rw-r--r--src/components/include/transport_manager/transport_manager.h14
-rw-r--r--src/components/include/utils/callable.h26
-rw-r--r--src/components/include/utils/logger.h6
-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.xml179
-rw-r--r--src/components/interfaces/MOBILE_API.xml275
-rw-r--r--src/components/interfaces/QT_HMI_API.xml9
-rw-r--r--src/components/media_manager/CMakeLists.txt118
-rw-r--r--src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h6
-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/media_manager.h68
-rw-r--r--src/components/media_manager/src/audio/a2dp_source_player_adapter.cc3
-rw-r--r--src/components/media_manager/src/audio/audio_stream_sender_thread.cc8
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc10
-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.cc6
-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/.gitignore85
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt121
-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/cache_manager.h919
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h794
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h328
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h508
-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.h178
-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.h583
-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.h507
-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.h148
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_representation.h211
-rw-r--r--src/components/policy/policy_external/include/policy/sql_wrapper.h45
-rw-r--r--src/components/policy/policy_external/include/policy/status.h195
-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/cache_manager.cc2666
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc870
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc1883
-rw-r--r--src/components/policy/policy_external/src/policy_table.cc52
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc723
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc2134
-rw-r--r--src/components/policy/policy_external/src/policy_table/validation.cc256
-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.cc972
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc1880
-rw-r--r--src/components/policy/policy_external/src/status.cc139
-rw-r--r--src/components/policy/policy_external/src/update_status_manager.cc260
-rw-r--r--src/components/policy/policy_external/src/usage_statistics/counter.cc126
-rw-r--r--src/components/policy/policy_external/test/CMakeLists.txt63
-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_cache_manager.h256
-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.txt120
-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/cache_manager.h772
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h644
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_helper.h248
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_listener.h116
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h380
-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.h163
-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.h478
-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.h125
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_representation.h203
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_wrapper.h44
-rw-r--r--src/components/policy/policy_regular/include/policy/status.h198
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager.h240
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager_interface.h121
-rw-r--r--src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h50
-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/cache_manager.cc1636
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc (renamed from src/components/policy/src/policy_helper.cc)0
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc1132
-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.cc (renamed from src/components/policy/src/policy_table/enums.cc)0
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc1389
-rw-r--r--src/components/policy/policy_regular/src/policy_table/validation.cc197
-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.cc (renamed from src/components/policy/src/sql_pt_queries.cc)0
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc1755
-rw-r--r--src/components/policy/policy_regular/src/status.cc141
-rw-r--r--src/components/policy/policy_regular/src/update_status_manager.cc260
-rw-r--r--src/components/policy/policy_regular/src/usage_statistics/counter.cc122
-rw-r--r--src/components/policy/policy_regular/test/CMakeLists.txt71
-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/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_app_stopwatch.h54
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h218
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h83
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h185
-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.cc1367
-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.cc1709
-rw-r--r--src/components/policy/policy_regular/test/update_status_manager_test.cc95
-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_manager_impl.cc1014
-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_representation.cc1752
-rw-r--r--src/components/policy/src/update_status_manager.cc270
-rw-r--r--src/components/policy/src/usage_statistics/counter.cc121
-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.cc1703
-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_handler/CMakeLists.txt14
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h10
-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/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/protocol_handler_tm_test.cc525
-rw-r--r--src/components/qt_hmi/test/CMakeLists.txt3
-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.h8
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h9
-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.h6
-rw-r--r--src/components/rpc_base/test/CMakeLists.txt31
-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.cc6
-rw-r--r--src/components/rpc_base/test/validation_report_test.cc6
-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/test/CMakeLists.txt24
-rw-r--r--src/components/security_manager/test/crypto_manager_impl_test.cc1
-rw-r--r--src/components/security_manager/test/security_manager_test.cc159
-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/smart_object.h3
-rw-r--r--src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc8
-rw-r--r--src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc7
-rw-r--r--src/components/smart_objects/test/ArraySchemaItem_test.cc7
-rw-r--r--src/components/smart_objects/test/BoolSchemaItem_test.cc12
-rw-r--r--src/components/smart_objects/test/CMakeLists.txt27
-rw-r--r--src/components/smart_objects/test/CObjectSchemaItem_test.cc12
-rw-r--r--src/components/smart_objects/test/EnumSchemaItem_test.cc11
-rw-r--r--src/components/smart_objects/test/NumberSchemaItem_test.cc6
-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.cc7
-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.txt31
-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.h6
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h6
-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.cc2
-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.txt106
-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/tcp/tcp_connection_factory.h5
-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.h14
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h2
-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.h14
-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_socket_connection.cc6
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc7
-rw-r--r--src/components/transport_manager/src/tcp/tcp_client_listener.cc15
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc25
-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.cc36
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc26
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc69
-rw-r--r--src/components/transport_manager/src/usb/usb_connection_factory.cc20
-rw-r--r--src/components/transport_manager/test/CMakeLists.txt28
-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.h70
-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.h4
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h129
-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.h108
-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/smartDeviceLink_test.ini15
-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.cc4
-rw-r--r--src/components/transport_manager/test/transport_adapter_test.cc52
-rw-r--r--src/components/transport_manager/test/transport_manager_default_test.cc53
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc130
-rw-r--r--src/components/utils/CMakeLists.txt107
-rw-r--r--src/components/utils/include/utils/helpers.h15
-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.h11
-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/include/utils/timer.h21
-rw-r--r--src/components/utils/src/custom_string.cc1
-rw-r--r--src/components/utils/src/lock_posix.cc2
-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.cc11
-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_posix.cc (renamed from src/components/utils/src/threads/posix_thread.cc)0
-rw-r--r--src/components/utils/src/timer.cc15
-rw-r--r--src/components/utils/test/CMakeLists.txt92
-rw-r--r--src/components/utils/test/async_runner_test.cc4
-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.cc4
-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.cc16
-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.cc4
-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.cc6
-rw-r--r--src/components/utils/test/shared_ptr_test.cc13
-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.cc8
-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/MOBILE_API.xml4999
-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
-rw-r--r--src/components/utils/test/timer_test.cc33
-rw-r--r--src/plugins/CMakeLists.txt2
-rw-r--r--src/plugins/appenders/CMakeLists.txt22
-rw-r--r--tools/InterfaceGenerator/MsgVersionGenerate.py16
-rw-r--r--tools/cmake/helpers/cotire.cmake3917
-rw-r--r--tools/cmake/helpers/generators.cmake62
-rw-r--r--tools/cmake/helpers/platform.cmake92
-rw-r--r--tools/cmake/helpers/sources.cmake167
-rw-r--r--tools/cmake/modules/FindGlib-2.0.cmake (renamed from cmake/Modules/FindGlib-2.0.cmake)0
-rw-r--r--tools/cmake/modules/FindGstreamer-1.0.cmake (renamed from cmake/Modules/FindGstreamer-1.0.cmake)0
-rw-r--r--tools/cmake/modules/FindLibXML2.cmake (renamed from cmake/Modules/FindLibXML2.cmake)0
-rw-r--r--tools/cmake/modules/FindQt5Core.cmake (renamed from cmake/Modules/FindQt5Core.cmake)0
-rw-r--r--tools/cmake/modules/FindQt5DBus.cmake (renamed from cmake/Modules/FindQt5DBus.cmake)0
-rw-r--r--tools/cmake/modules/FindQt5Qml.cmake (renamed from cmake/Modules/FindQt5Qml.cmake)0
-rw-r--r--tools/cmake/modules/FindQt5Quick.cmake (renamed from cmake/Modules/FindQt5Quick.cmake)0
-rw-r--r--tools/cmake/modules/FindSDLGstreamer.cmake42
-rw-r--r--tools/cmake/modules/FindSDLLibUSB.cmake19
-rw-r--r--tools/cmake/modules/FindSDLOpenSSL.cmake18
-rw-r--r--tools/cmake/modules/FindSqlite3.cmake81
-rw-r--r--tools/cmake/modules/FindUDev.cmake53
-rw-r--r--tools/infrastructure/api_compare.py468
-rwxr-xr-xtools/infrastructure/check_style.sh20
-rwxr-xr-xtools/infrastructure/show_disabled.sh27
-rw-r--r--tools/intergen/GenerateInterfaceLibrary.cmake1
-rw-r--r--tools/intergen/test/CMakeLists.txt4
-rw-r--r--tools/policy_table_validator/CMakeLists.txt7
-rw-r--r--tools/policy_table_validator/main.cpp19
1445 files changed, 173025 insertions, 108574 deletions
diff --git a/.clang-format b/.clang-format
index 8515b05b85..1df4dd03b4 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,5 +1,6 @@
---
Language: Cpp
+Standard: Cpp03
BasedOnStyle: Google
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
@@ -9,3 +10,6 @@ BinPackParameters: false
BreakConstructorInitializersBeforeComma: true
DerivePointerAlignment: false
TabWidth: 2
+# Force pointers to the type for C++.
+DerivePointerAlignment: false
+PointerAlignment: Left
diff --git a/.gitignore b/.gitignore
index 6c1cc2cdf2..c552e22d6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,7 @@
build/
-*.user
+*.user*
src/appMain/sdl_preloaded_pt.json
+CMakeCache.txt
+CMakeFiles/
+*.pyc
+.idea
diff --git a/.travis.yml b/.travis.yml
index 8b2ba0051b..01d79384d3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,28 +21,24 @@ addons:
- libbluetooth3
- libbluetooth-dev
- libudev-dev
+ - libusb-1.0
- cmake
- html2text
- clang-format-3.6
- coverity_scan:
- project:
- name: "smartdevicelink/sdl_core"
- description: "Build submitted via Travis CI"
- notification_email: jack@livio.io
- build_command_prepend: "mkdir build && cd build && cmake ../ -DBUILD_TESTS=ON -DENABLE_GCOV=ON"
- build_command: "make install"
- branch_pattern: coverity
+ - binutils
before_install:
- sudo apt-get -qq update
- - sudo apt-get -q -y install libavahi-client-dev bluez-tools sqlite3 libsqlite3-dev automake1.11
+ - sudo apt-get -q -y install bluez-tools sqlite3 libsqlite3-dev automake1.11
- wget http://archive.ubuntu.com/ubuntu/pool/main/l/lcov/lcov_1.11-3_all.deb
- sudo dpkg -i lcov_1.11-3_all.deb
script:
- sudo ln -sf /usr/bin/gcov-4.9 /usr/bin/gcov
- bash -e tools/infrastructure/check_style.sh
+ - echo "Number of processing units available ${PROCESSING_UNITS_COUNT}"
+ - mkdir build && cd build && cmake ../ -DBUILD_TESTS=ON -DENABLE_GCOV=ON && make install -j${PROCESSING_UNITS_COUNT}
- sudo ldconfig
- - cd build
- - make test
+ - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/bin/lib ; make test
+ - bash ../tools/infrastructure/show_disabled.sh
- bash -ex ../tools/infrastructure/collect_coverage.sh ./
env:
global:
@@ -51,9 +47,7 @@ env:
- CMAKE_CXX_COMPILER=g++-4.9
- CMAKE_C_COMPILER=gcc-4.9
- LD_LIBRARY_PATH=.
- # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
- # via the "travis encrypt" command using the project repo's public key
- - secure: "gGRieQzK0ExcuQRaMs/8mbXK4gitDSBs9RFV/iIqVUeKv+1ZyA4UP4tGAFXeY8Kl0sbRtld7t03Wx1/u0JI1bON2XMn/wCj0Hr8kbwt3eJr1bpG8dVr0tqDpfYVsBjX/nMxwNNBillvBpyXRoZf8z7ukZJAyRMMVG5tHqUVJM4k="
+ - PROCESSING_UNITS_COUNT=$("nproc")
after_success:
- pwd ; bash <(curl -s https://codecov.io/bash) -f ./coverage/coverage.info || echo "Codecov did not collect coverage reports"
deploy:
@@ -67,10 +61,6 @@ deploy:
notifications:
email:
- AKutsan@luxoft.com
- - AByzhynar@luxoft.com
- NSnitsar@luxoft.com
- - RMalynovskyi@luxoft.com
- MGhiumiusliu@luxoft.com
- - AGaliuzov@luxoft.com
- - ANosach@luxoft.com
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b5fb06edf9..a4b1465540 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,9 +28,13 @@
# 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.0)
+cmake_minimum_required(VERSION 2.8.11)
set (PROJECT smartDeviceLinkCore)
+project (${PROJECT})
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/tools/cmake/modules/")
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
#Jenkins integration section
#dont modify this section if you dont know details about integration with Jenkins!!!
@@ -49,9 +53,18 @@ option(ENABLE_SANITIZE "Sanitize tool" OFF)
option(ENABLE_SECURITY "Security Ford protocol protection" ON)
option(ENABLE_HMI_PTU_DECRYPTION "Policy table update parsed by hmi" ON)
option(ENABLE_EXTENDED_POLICY "Turns extended flow which requires embedded system interaction" ON)
+option(USE_COTIRE "Use Cotire to speed up build (currently only for commands tests)" ON)
+option(USE_GOLD_LD "Use gold linker intead of GNU linker" ON)
+option(USE_CCACHE "Turn on ccache usage" ON)
+option(USE_DISTCC "Turn on distributed build_usage" ON)
+
+set (EXTENDED_POLICY "PROPRIETARY" CACHE STRING "Policy mode (PROPRIETARY, HTTP or EXTERNAL_PROPRIETARY)")
+set_property(CACHE EXTENDED_POLICY PROPERTY STRINGS PROPRIETARY HTTP EXTERNAL_PROPRIETARY)
+if(EXTENDED_POLICY STREQUAL "")
+ set(EXTENDED_POLICY "PROPRIETARY")
+endif()
set(OS_TYPE_OPTION "$ENV{OS_TYPE}")
-set(DEBUG_OPTION "$ENV{DEBUG}")
set(HMI_TYPE_OPTION "$ENV{HMI_TYPE}")
set(TARGET_OPTION "$ENV{TARGET}")
set(MEDIA_MODE_OPTION "$ENV{MEDIA_MODE}")
@@ -63,9 +76,9 @@ set(POLICY_OPTION "$ENV{POLICY_TYPE}")
set(SECURITY_OPTION "$ENV{SECURITY_MODE}")
set(COMPONENTS_DIR ${CMAKE_SOURCE_DIR}/src/components)
set(SNAPSHOT_TAG "$ENV{SNAPSHOT_TAG}")
-
set(CMAKE_CXX_COMPILER $ENV{CMAKE_CXX_COMPILER})
set(CMAKE_C_COMPILER $ENV{CMAKE_C_COMPILER})
+set(BUILDDIR "$ENV{BUILDDIR}")
if (ARCH_TYPE_OPTION)
if (NOT (${ARCH_TYPE_OPTION} STREQUAL "x86") AND NOT (${ARCH_TYPE_OPTION} STREQUAL "armv7"))
@@ -96,11 +109,8 @@ if (MEDIA_MODE_OPTION)
endif()
endif()
-if (DEBUG_OPTION)
- if (${DEBUG_OPTION} STREQUAL "DBG_OFF")
- message(STATUS "Jenkins integration: build release version")
- set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
- endif()
+if( NOT CMAKE_BUILD_TYPE )
+ set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build. Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
endif()
if (HMI_ADAPTER_OPTION)
@@ -110,9 +120,6 @@ if (HMI_ADAPTER_OPTION)
elseif (${HMI_ADAPTER_OPTION} STREQUAL "DBUS")
message(STATUS "Jenkins integration: selected HMI adapter DBUS")
set (HMIADAPTER "dbus")
- elseif (${HMI_ADAPTER_OPTION} STREQUAL "MQUEUE")
- message(STATUS "Jenkins integration: selected HMI adapter MQUEUE")
- set (HMIADAPTER "mqueue")
endif()
endif()
@@ -186,13 +193,59 @@ set(ARCHIVE_OUTPUT_DIRECTORY ./bin)
set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wno-deprecated-declarations -Wuninitialized -Wvla")
+if (USE_GOLD_LD)
+ execute_process(COMMAND ld -v OUTPUT_VARIABLE result)
+ string(FIND ${result} Binutils GOLD_LD_FOUND)
+ if (GOLD_LD_FOUND EQUAL -1)
+ message(SEND_ERROR "Gold linker not found!")
+ else()
+ message(INFO " Use gold linker")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
+ endif()
+endif(USE_GOLD_LD)
+
+if (USE_CCACHE)
+# Configure CCache if available
+ find_program(CCACHE_FOUND ccache)
+ if(CCACHE_FOUND)
+ get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
+ set(RULE_LAUNCH_COMPILE "${RULE_LAUNCH_COMPILE} ccache")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${RULE_LAUNCH_COMPILE})
+
+ get_property(RULE_LAUNCH_LINK GLOBAL PROPERTY RULE_LAUNCH_LINK)
+ set(RULE_LAUNCH_LINK "${RULE_LAUNCH_LINK} ccache")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${RULE_LAUNCH_LINK})
+
+ message(INFO " Used CCache for compilation.")
+ else(CCACHE_FOUND)
+ message(WARNING " CCache was not found.")
+ endif(CCACHE_FOUND)
+endif(USE_CCACHE)
+
+if (USE_DISTCC)
+# Configure distributed compilation if available
+ find_program(DISTCC_FOUND distcc)
+ if(DISTCC_FOUND)
+ get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
+ set(RULE_LAUNCH_COMPILE "${RULE_LAUNCH_COMPILE} distcc")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${RULE_LAUNCH_COMPILE})
+ message(INFO " Used distributed build.")
+ else(CCACHE_FOUND)
+ message(WARNING " distcc was not found. Distributed compilation is impossible.")
+ endif(DISTCC_FOUND)
+endif(USE_DISTCC)
+
if(ENABLE_SANITIZE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
+ message(STATUS "Sanitizing enabled")
endif()
+
if(ENABLE_GCOV)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
add_definitions(-DGCOV_ENABLED)
+ message(STATUS "GCOV enabled")
endif()
+
set(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -s -O2")
set(CMAKE_CXX_FLAGS_DEBUG " -DDEBUG -g3 -ggdb3")
@@ -208,133 +261,86 @@ endif()
if (BUILD_USB_SUPPORT)
add_definitions(-DUSB_SUPPORT)
- message(STATUS "USB support is enabled")
+ find_package(UDev REQUIRED)
+ message(STATUS "USB support enabled")
endif()
if (BUILD_BT_SUPPORT)
add_definitions(-DBLUETOOTH_SUPPORT)
- message(STATUS "Bluetooth support is enabled")
+ message(STATUS "Bluetooth support enabled")
endif()
if (BUILD_BACKTRACE_SUPPORT)
add_definitions(-DBACKTRACE_SUPPORT)
+ message(STATUS "Backtrace support enabled")
endif()
if(ENABLE_LOG)
add_definitions(-DENABLE_LOG)
set(install-3rd_party_logger "install-3rd_party_logger")
+ message(STATUS "Logger enabled")
endif()
if (TELEMETRY_MONITOR)
- add_definitions(-DTELEMETRY_MONITOR)
-endif()
-
-if (ENABLE_EXTENDED_POLICY)
- add_definitions(-DEXTENDED_POLICY)
+ add_definitions(-DTELEMETRY_MONITOR)
+ message(STATUS "Telemetry monitor enabled")
+endif()
+
+if (${EXTENDED_POLICY} STREQUAL "EXTERNAL_PROPRIETARY")
+ add_definitions(-DEXTERNAL_PROPRIETARY_MODE)
+ set(POLICY_PATH ${COMPONENTS_DIR}/policy/policy_external/)
+ set(POLICY_GLOBAL_INCLUDE_PATH ${COMPONENTS_DIR}/include/policy/policy_external/)
+ set(POLICY_MOCK_INCLUDE_PATH ${COMPONENTS_DIR}/include/test/policy/policy_external/)
+ message(STATUS "EXTERNAL_PROPRIETARY policy enabled")
+else()
+ if (${EXTENDED_POLICY} STREQUAL "PROPRIETARY")
+ add_definitions(-DPROPRIETARY_MODE)
+ message(STATUS "PROPRIETARY policy enabled")
+ else()
+ message(STATUS "HTTP policy enabled")
+ endif()
+ set(POLICY_PATH ${COMPONENTS_DIR}/policy/policy_regular/)
+ set(POLICY_GLOBAL_INCLUDE_PATH ${COMPONENTS_DIR}/include/policy/policy_regular/)
+ set(POLICY_MOCK_INCLUDE_PATH ${COMPONENTS_DIR}/include/test/policy/policy_regular/)
endif()
# TODO(AK): check current OS here
add_definitions(-DOS_POSIX)
if (EXTENDED_MEDIA_MODE)
-add_definitions(-DEXTENDED_MEDIA_MODE)
-# required to find 'glibconfig.h'
-find_package(PkgConfig)
-pkg_check_modules(GLIB2 REQUIRED glib-2.0)
-add_definitions(${GLIB2_CFLAGS})
+ add_definitions(-DEXTENDED_MEDIA_MODE)
+ message(STATUS "Extended media mode enabled")
+ # required to find 'glibconfig.h'
+ find_package(PkgConfig)
+ pkg_check_modules(GLIB2 REQUIRED glib-2.0)
+ add_definitions(${GLIB2_CFLAGS})
endif()
-
-# --- Interface generator
-
-find_package(PythonInterp)
-if(NOT PYTHONINTERP_FOUND)
- message(STATUS "Python interpreter is not found")
- message(STATUS "To install it type in the command line:")
- message(STATUS "sudo apt-get install python")
- message(FATAL_ERROR "Exiting!")
-endif(NOT PYTHONINTERP_FOUND)
-
-if (HMI STREQUAL "qt")
- cmake_minimum_required(VERSION 2.8.11)
- if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- set(qt_version "4.8.5")
- else ()
- set(qt_version "5.1.0")
- endif ()
-
- execute_process(
- COMMAND ${CMAKE_SOURCE_DIR}/FindQt.sh -v ${qt_version}
- OUTPUT_VARIABLE qt_bin_dir
- )
- message(STATUS "Binary directory Qt ${qt_version} is ${qt_bin_dir}")
- set(ENV{PATH} ${qt_bin_dir}:$ENV{PATH})
-
- if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- find_package(Qt4 ${qt_version} REQUIRED QtCore QtGui QtDBus QtDeclarative)
- else ()
- find_package(Qt5Core REQUIRED)
- find_package(Qt5DBus REQUIRED)
- find_package(Qt5Qml REQUIRED)
- find_package(Qt5Quick REQUIRED)
- set(qmlplugindump_binary ${qt_bin_dir}/qmlplugindump)
- endif ()
-endif()
-
-set(INTEFRACE_GENERATOR "${PROJECT_SOURCE_DIR}/tools/InterfaceGenerator/Generator.py")
-set(INTEFRACE_GENERATOR_CMD ${PYTHON_EXECUTABLE} -B ${INTEFRACE_GENERATOR})
-file(GLOB_RECURSE INTERFACE_GENERATOR_DEPENDENCIES "${PROJECT_SOURCE_DIR}/tools/InterfaceGenerator/*.*")
-
-macro (GenerateInterface arg_xml_name arg_namespace parser_type)
- string(REGEX MATCH "^[a-zA-Z_0-9]*[^.]" file_name ${arg_xml_name}) # TODO: make expression more robust
-
- set(hpp_file
- "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.h"
- "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_schema.h"
- )
-
- set(cpp_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_schema.cc")
- set(full_xml_name "${CMAKE_CURRENT_SOURCE_DIR}/${arg_xml_name}")
-
- add_custom_command( OUTPUT ${hpp_file} ${cpp_file}
- COMMAND ${INTEFRACE_GENERATOR_CMD} ${full_xml_name} ${arg_namespace} ${CMAKE_CURRENT_BINARY_DIR} "--parser-type" "${parser_type}"
- DEPENDS ${INTERFACE_GENERATOR_DEPENDENCIES} ${full_xml_name}
- COMMENT "Generating files:\n ${hpp_file}\n ${cpp_file}\nfrom:\n ${arg_xml_name} ..."
- VERBATIM
- )
-
- include_directories (
- ${COMPONENTS_DIR}/smart_objects/include
- ${COMPONENTS_DIR}/formatters/include/
- ${CMAKE_BINARY_DIR}
- )
-
- add_library("${file_name}" ${cpp_file})
-endmacro(GenerateInterface)
-
-# --- Useful macro
-macro(create_test NAME SOURCES LIBS)
- add_executable("${NAME}" ${CMAKE_SOURCE_DIR}/src/components/test_main.cc ${SOURCES})
- target_link_libraries("${NAME}" ${LIBS})
- target_link_libraries("${NAME}" Utils)
+if(HMI STREQUAL "qt")
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
- add_test(${NAME} ${CMAKE_SOURCE_DIR}/qnx/remote_run_test.sh ${NAME})
- elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_test(NAME ${NAME}
- COMMAND ${NAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/)
+ set(qt_version "4.8.5")
else()
- add_test(${NAME} ${NAME})
+ set(qt_version "5.1.0")
endif()
-endmacro(create_test)
-# --replace in list macro
-macro(LIST_REPLACE LIST INDEX NEWVALUE)
- list(INSERT ${LIST} ${INDEX} ${NEWVALUE})
- MATH(EXPR __INDEX "${INDEX} + 1")
- list (REMOVE_AT ${LIST} ${__INDEX})
-endmacro(LIST_REPLACE)
+ execute_process(
+ COMMAND ${CMAKE_SOURCE_DIR}/FindQt.sh -v ${qt_version}
+ OUTPUT_VARIABLE qt_bin_dir
+ )
+ message(STATUS "Binary directory Qt ${qt_version} is ${qt_bin_dir}")
+ set(ENV{PATH} ${qt_bin_dir}:$ENV{PATH})
+ if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ find_package(Qt4 ${qt_version} REQUIRED QtCore QtGui QtDBus QtDeclarative)
+ else ()
+ find_package(Qt5Core REQUIRED)
+ find_package(Qt5DBus REQUIRED)
+ find_package(Qt5Qml REQUIRED)
+ find_package(Qt5Quick REQUIRED)
+ set(qmlplugindump_binary ${qt_bin_dir}/qmlplugindump)
+ endif()
+endif()
# Building application
@@ -356,9 +362,6 @@ endif()
if (HMI STREQUAL "web" AND NOT DEFINED HMIADAPTER)
set(HMIADAPTER "messagebroker")
endif()
-if (HMI STREQUAL "no" AND NOT DEFINED HMIADAPTER)
- set(HMIADAPTER "mqueue")
-endif()
if (HMIADAPTER STREQUAL "dbus")
set(HMI_DBUS_API ON)
@@ -371,253 +374,17 @@ if (HMIADAPTER STREQUAL "messagebroker")
add_definitions(-DMESSAGEBROKER_HMIADAPTER)
add_definitions(-DHMI_JSON_API)
endif()
-if (HMIADAPTER STREQUAL "mqueue")
- set(HMI_JSON_API ON)
- add_definitions(-DMQUEUE_HMIADAPTER)
- add_definitions(-DHMI_JSON_API)
-endif()
# --- Directory with SDL interfaces, global types and ProtocolLib component
include_directories(
${COMPONENTS_DIR}/include
${COMPONENTS_DIR}/protocol/include
-if (BUILD_TESTS)
- ${COMPONENTS_DIR}/include/test
-endif ()
)
# --- 3rd party libs
-INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/src/3rd_party/set_3rd_party_paths.cmake)
-
-set(3RD_PARTY_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/3rd_party)
-set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src/3rd_party)
-
-set (install-3rd_party_logger_var "")
-set (install-3rd_party_dbus_var "")
-
-if(NO_REBUILD_3RD_PARTY)
- set(NO_REBUILD_3RD_PARTY_LOGGER ON)
- set(NO_REBUILD_3RD_PARTY_DBUS ON)
-endif()
-
-if(FORCE_3RD_PARTY)
- if(NO_REBUILD_3RD_PARTY)
- message(FATAL_ERROR "Please don't turn on both FORCE_3RD_PARTY and NO_REBUILD_3RD_PARTY at the same time.")
- else()
- set(FORCE_3RD_PARTY_LOGGER ON)
- set(FORCE_3RD_PARTY_DBUS ON)
- endif()
-endif()
-
-if(ENABLE_LOG)
- if(NO_REBUILD_3RD_PARTY_LOGGER)
- message(STATUS "Not rebuilding logger.")
- else()
- if(FORCE_3RD_PARTY_LOGGER)
- message(STATUS "Force to rebuild logger.")
-
- #build logger
- add_custom_target(3rd_party_logger
- make
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
-
- #install logger
- #install either to default place with sudo or non-default plase without sudo.
- #to install with sudo to non-default place use manual installation
- add_custom_target(install-3rd_party_logger
- COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
- if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
- sudo -k \;
- sudo make install\;
- else
- make install\;
- fi\"
- DEPENDS 3rd_party_logger
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
- else()
- #build logger
- add_custom_target(3rd_party_logger
- COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} &&
- grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]\; then
- VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\;
- VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
- VAR2=-1\;
- cd ${CMAKE_CURRENT_SOURCE_DIR}\;
- git log . 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]; then
- VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\;
- fi\;
- if [ \\$$VAR1 != \\$$VAR2 ]\; then
- echo " Need to rebuild logger. " \;
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- make\;
- else
- echo " Logger is actual. " \;
- fi\;
- else
- echo " Need to build logger. " \;
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- make\;
- fi\"
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
-
- #install logger
- #install either to default place with sudo or non-default plase without sudo.
- #to install with sudo to non-default place use manual installation
- add_custom_target(install-3rd_party_logger
- COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} &&
- grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]\; then
- VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\;
- VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
- VAR2=-1\;
- cd ${CMAKE_CURRENT_SOURCE_DIR}\;
- git log . 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]; then
- VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\;
- fi\;
- if [ \\$$VAR1 != \\$$VAR2 ]\; then
- USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
- if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- sudo -k \;
- sudo make install\;
- else
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- make install\;
- fi\;
- fi\;
- else
- USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
- if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- sudo -k \;
- sudo make install\;
- else
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- make install\;
- fi\;
- fi\"
- DEPENDS 3rd_party_logger
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
- endif()
-
- set (install-3rd_party_logger_var "install-3rd_party_logger")
- endif()
-endif()
-
-if (HMIADAPTER STREQUAL "dbus")
- if(NO_REBUILD_3RD_PARTY_DBUS)
- message(STATUS "Not rebuilding D-Bus.")
- else()
- if(FORCE_3RD_PARTY_DBUS)
- message(STATUS "Force to rebuild D-Bus.")
-
- #build d-bus
- add_custom_target(3rd_party_dbus
- make
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
-
- #install d-bus
- #install either to default place with sudo or non-default plase without sudo.
- #to install with sudo to non-default place use manual installation
- add_custom_target(install-3rd_party_dbus
- COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
- if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
- sudo -k \;
- sudo make install\;
- else
- make install\;
- fi\"
- DEPENDS 3rd_party_dbus
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
- else()
- #build d-bus
- add_custom_target(3rd_party_dbus
- COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]\; then
- VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\;
- VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
- VAR2=-1\;
- cd ${CMAKE_CURRENT_SOURCE_DIR}\;
- git log . 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]; then
- VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\;
- fi\;
- if [ \\$$VAR1 != \\$$VAR2 ]\; then
- echo " Need to rebuild D-Bus. " \;
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- make\;
- else
- echo " D-Bus is actual. " \;
- fi\;
- else
- echo " Need to build D-Bus. " \;
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- make\;
- fi\"
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
-
- #install d-bus
- #install either to default place with sudo or non-default plase without sudo.
- #to install with sudo to non-default place use manual installation
- add_custom_target(install-3rd_party_dbus
- COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]\; then
- VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\;
- VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
- VAR2=-1\;
- cd ${CMAKE_CURRENT_SOURCE_DIR}\;
- git log . 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]; then
- VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\;
- fi\;
- if [ \\$$VAR1 != \\$$VAR2 ]\; then
- USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
- if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- sudo -k \;
- sudo make install\;
- else
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- make install\;
- fi\;
- fi\;
- else
- USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
- if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- sudo -k \;
- sudo make install\;
- else
- cd ${3RD_PARTY_BINARY_DIRECTORY}\;
- make install\;
- fi\;
- fi\"
- DEPENDS 3rd_party_dbus
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
- endif()
-
- set (install-3rd_party_dbus_var "install-3rd_party_dbus")
- endif()
-endif()
-
-add_subdirectory(${3RD_PARTY_SOURCE_DIRECTORY} ${3RD_PARTY_BINARY_DIRECTORY} EXCLUDE_FROM_ALL)
-add_custom_target(install-3rd_party
- DEPENDS ${install-3rd_party_logger_var}
- DEPENDS ${install-3rd_party_dbus_var}
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
-)
+add_subdirectory(./src/3rd_party EXCLUDE_FROM_ALL)
+find_package(OpenSSL REQUIRED)
if(ENABLE_LOG)
include_directories ( ${LOG4CXX_INCLUDE_DIRECTORY} )
endif()
@@ -627,25 +394,27 @@ if(ENABLE_SECURITY)
set(SecurityManagerLibrary SecurityManager)
set(SecurityManagerIncludeDir ${COMPONENTS_DIR}/security_manager/include)
#set(SecurityManagerTestIncludeDir ${CMAKE_SOURCE_DIR}/test/components/security_manager/include)
+ message(STATUS "Security enabled")
endif()
if(ENABLE_HMI_PTU_DECRYPTION)
- MESSAGE("USE DHMI_PTU_PARSER")
add_definitions(-DUSE_HMI_PTU_DECRYPTION)
+ message(STATUS "HMI PTU decription enabled")
endif()
set(RTLIB rt)
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
-set(RTLIB )
+ set(RTLIB )
endif()
# Building tests
if(BUILD_TESTS)
enable_testing()
add_definitions(-DBUILD_TESTS)
- # Framework GoogleTest is also integrated together gmock
- # and must not be added separately
- add_subdirectory(./src/3rd_party-static/gmock-1.7.0)
+ include_directories(
+ ${COMPONENTS_DIR}/include/test
+ )
+ message(STATUS "Tests enabled")
endif()
# --- 3rd party libs (static)
@@ -654,7 +423,6 @@ add_subdirectory(./src/3rd_party-static)
# --- Tools
add_subdirectory(./tools)
-
# --- Components
add_subdirectory(./src/components)
@@ -664,35 +432,31 @@ add_subdirectory(./src/appMain)
# --- Plugins
add_subdirectory(./src/plugins)
-
-# Building tests
-if(BUILD_TESTS)
- # Directory test is deprecated. Use src/components/<name>/test
- include(Dart)
- #add_subdirectory(./test)
-endif()
+add_dependencies(${PROJECT} Policy)
+add_dependencies(${PROJECT} copy_policy_library)
# Building documentation
# At first creating directory for generated documentation. Unfortunately doxygen
# cannot generate it byself
-FIND_PACKAGE(Doxygen)
- IF(DOXYGEN_FOUND)
+find_package(Doxygen)
+ if(DOXYGEN_FOUND)
option(DOXYGEN_ENABLE_DIAGRAMS "Enable graphical diagram generation" ON)
+ message(STATUS "Doxygen found. Documentation will be generated")
if(DOXYGEN_ENABLE_DIAGRAMS)
set(DOXYGEN_ENABLE_DIAGRAMS_PARAM "YES")
- else(DOXYGEN_ENABLE_DIAGRAMS)
+ else()
set(DOXYGEN_ENABLE_DIAGRAMS_PARAM "NO")
endif()
configure_file("${PROJECT_SOURCE_DIR}/Doxyfile" "${PROJECT_BINARY_DIR}/Doxyfile")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/doc/doxygen")
- ADD_CUSTOM_TARGET(doxygen COMMAND ${DOXYGEN_EXECUTABLE} "${PROJECT_BINARY_DIR}/Doxyfile")
- ELSE(DOXYGEN_FOUND)
- MESSAGE(STATUS "Doxygen not found. Documentation will not be generated")
- MESSAGE(STATUS "To enable documentation generation please install doxygen and graphviz packages")
- MESSAGE(STATUS "sudo apt-get install doxygen graphviz")
- MESSAGE(STATUS "To enable processing of MscGen comments please install mscgen")
- MESSAGE(STATUS "sudo apt-get install mscgen")
-ENDIF(DOXYGEN_FOUND)
+ add_custom_target(doxygen COMMAND ${DOXYGEN_EXECUTABLE} "${PROJECT_BINARY_DIR}/Doxyfile")
+ else()
+ message(STATUS "Doxygen not found. Documentation will not be generated")
+ message(STATUS "To enable documentation generation please install doxygen and graphviz packages")
+ message(STATUS "sudo apt-get install doxygen graphviz")
+ message(STATUS "To enable processing of MscGen comments please install mscgen")
+ message(STATUS "sudo apt-get install mscgen")
+endif()
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a07423d5bb..42cf5d0898 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,7 +25,7 @@ We use <a href="http://nvie.com/posts/a-successful-git-branching-model/">Gitflow
* A great example of a [pull request can be found here](https://github.com/smartdevicelink/SmartDeviceLink-iOS/pull/45).
### Contributor's License Agreement (CLA)
-In order to accept Pull Requests from contributors, you must first sign [the Contributor's License Agreement](https://docs.google.com/forms/d/1VNR8EUd5b46cQ7uNbCq1fJmnu0askNpUp5dudLKRGpU/viewform). If you need to make a change to information that you entered, [please contact us](mailto:justin@livio.io).
+In order to accept Pull Requests from contributors, you must first sign [the Contributor's License Agreement](https://docs.google.com/forms/d/1VNR8EUd5b46cQ7uNbCq1fJmnu0askNpUp5dudLKRGpU/viewform). If you need to make a change to information that you entered, [please contact us](mailto:theresa@livio.io).
## Additional Resources
* [General GitHub documentation](https://help.github.com/)
diff --git a/Doxyfile b/Doxyfile
index e641d760ff..0b46c939b6 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -1,104 +1,122 @@
-# Doxyfile 1.8.3.1
+# Doxyfile 1.8.9.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored.
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ").
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or sequence of words) that should
-# identify the project. Note that if you do not use Doxywizard you need
-# to put quotes around the project name if it contains spaces.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
PROJECT_NAME = SmartDeviceLink
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
PROJECT_NUMBER =
# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer
-# a quick idea about the purpose of the project. Keep the description short.
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
-# With the PROJECT_LOGO tag one can specify an logo or icon that is
-# included in the documentation. The maximum height of the logo should not
-# exceed 55 pixels and the maximum width should not exceed 200 pixels.
-# Doxygen will copy the logo to the output directory.
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
PROJECT_LOGO =
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
-OUTPUT_DIRECTORY = doc
+OUTPUT_DIRECTORY = docs
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
CREATE_SUBDIRS = YES
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
+# The default value is: YES.
REPEAT_BRIEF = YES
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
@@ -113,8 +131,9 @@ ABBREVIATE_BRIEF = "The $name class" \
the
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# doxygen will generate a detailed section even if there is only a brief
# description.
+# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
@@ -122,247 +141,269 @@ ALWAYS_DETAILED_SEC = NO
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
+# The default value is: NO.
INLINE_INHERITED_MEMB = NO
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
FULL_PATH_NAMES = YES
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip. Note that you specify absolute paths here, but also
-# relative paths, which will be relative from the directory where doxygen is
-# started.
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
STRIP_FROM_INC_PATH =
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful if your file system
-# doesn't support long names like on DOS, Mac, or CD-ROM.
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
SHORT_NAMES = NO
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
QT_AUTOBRIEF = NO
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
INHERIT_DOCS = YES
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 4
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding
-# "class=itcl::class" will allow you to use the command class in the
-# itcl::class meaning.
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension,
-# and language is one of the parsers supported by doxygen: IDL, Java,
-# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
-# C++. For instance to make doxygen treat .inc files as Fortran files (default
-# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
-# that for custom extensions you also need to set FILE_PATTERNS otherwise the
-# files are not read by doxygen.
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
EXTENSION_MAPPING =
-# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
-# comments according to the Markdown format, which allows for more readable
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you
-# can mix doxygen, HTML, and XML commands with Markdown formatting.
-# Disable only in case of backward compatibilities issues.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
MARKDOWN_SUPPORT = YES
-# When enabled doxygen tries to link words that correspond to documented classes,
-# or namespaces to their corresponding documentation. Such a link can be
-# prevented in individual cases by by putting a % sign in front of the word or
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also makes the inheritance and collaboration
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
+# The default value is: NO.
CPP_CLI_SUPPORT = YES
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES (the
-# default) will make doxygen replace the get and set methods by a property in
-# the documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
IDL_PROPERTY_SUPPORT = NO
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
+# tag is set to YES then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
+# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
SUBGROUPING = YES
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
-# unions are shown inside the group in which they are included (e.g. using
-# @ingroup) instead of on a separate page (for HTML and Man pages) or
-# section (for LaTeX and RTF).
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
-# unions with only public data fields will be shown inline in the documentation
-# of the scope in which they are defined (i.e. file, namespace, or group
-# documentation), provided this scope is documented. If set to NO (the default),
-# structs, classes, and unions are shown on a separate page (for HTML and Man
-# pages) or section (for LaTeX and RTF).
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penalty.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will roughly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
-
-SYMBOL_CACHE_SIZE = 0
-
-# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
-# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
-# their name and scope. Since this can be an expensive process and often the
-# same symbol appear multiple times in the code, doxygen keeps a cache of
-# pre-resolved symbols. If the cache is too small doxygen will become slower.
-# If the cache is too large, memory is wasted. The cache size is given by this
-# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
@@ -370,331 +411,384 @@ LOOKUP_CACHE_SIZE = 0
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
EXTRACT_PRIVATE = NO
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
+# The default value is: NO.
EXTRACT_PACKAGE = NO
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
EXTRACT_STATIC = YES
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespaces are hidden.
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
CASE_SENSE_NAMES = NO
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
HIDE_SCOPE_NAMES = NO
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
SHOW_INCLUDE_FILES = YES
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
SORT_MEMBER_DOCS = YES
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
SORT_BRIEF_DOCS = NO
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
-SORT_MEMBERS_CTORS_1ST = NO
+SORT_MEMBERS_CTORS_1ST = YES
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
SORT_GROUP_NAMES = NO
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
-# do proper type resolution of all parameters of a function it will reject a
-# match between the prototype and the implementation of a member function even
-# if there is only one candidate or it is obvious which candidate to choose
-# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
-# will still accept a match between prototype and implementation in such cases.
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
STRICT_PROTO_MATCHING = NO
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if section-label ... \endif
-# and \cond section-label ... \endcond blocks.
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or macro consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and macros in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
SHOW_USED_FILES = YES
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
SHOW_FILES = YES
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
LAYOUT_FILE =
-# The CITE_BIB_FILES tag can be used to specify one or more bib files
-# containing the references data. This must be a list of .bib files. The
-# .bib extension is automatically appended if omitted. Using this command
-# requires the bibtex tool to be installed. See also
-# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
-# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
-# feature you need bibtex and perl available in the search path. Do not use
-# file names with spaces, bibtex cannot handle them.
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
WARN_IF_DOC_ERROR = YES
-# The WARN_NO_PARAMDOC option can be enabled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation.
+# The default value is: NO.
WARN_NO_PARAMDOC = YES
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
-INPUT = ./
+INPUT = docs/ \
+ src/components \
+ src/appMain
# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
-# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
-# *.f90 *.f *.for *.vhd *.vhdl
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
FILE_PATTERNS = *.c \
*.cc \
@@ -730,19 +824,22 @@ FILE_PATTERNS = *.c \
*.vhdl \
*.txt
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = **/CMakeLists.txt \
+ docs/FORD.OpenSDL.SDD.TPL.dox
+ src/components/test_main.cc
src/thirdPartyLibs \
tools/FlexeLint \
tools/OtrosLogViewer \
@@ -753,835 +850,1149 @@ EXCLUDE = **/CMakeLists.txt \
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
+# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS = */test/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
EXAMPLE_PATTERNS = *
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
EXAMPLE_RECURSIVE = NO
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
-IMAGE_PATH =
+IMAGE_PATH = \
+ src/components/security_manager/docs/assets
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty or if
-# non of the patterns match the file name, INPUT_FILTER is applied.
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
-# and it is also possible to disable source filtering for a specific pattern
-# using *.ext= (so without naming a filter). This option only has effect when
-# FILTER_SOURCE_FILES is enabled.
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
-# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page (index.html).
-# This can be useful if you have a project on for instance GitHub and want reuse
-# the introduction page also for the doxygen output.
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
SOURCE_BROWSER = YES
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
INLINE_SOURCES = NO
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C, C++ and Fortran comments will always remain visible.
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
STRIP_CODE_COMMENTS = YES
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
REFERENCED_BY_RELATION = YES
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
REFERENCES_RELATION = YES
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
VERBATIM_HEADERS = YES
+# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
+# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
+# cost of reduced performance. This can be particularly helpful with template
+# rich C++ code for which doxygen's built-in parser lacks the necessary type
+# information.
+# Note: The availability of this option depends on whether or not doxygen was
+# compiled with the --with-libclang option.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS =
+
#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
ALPHABETICAL_INDEX = YES
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header. Note that when using a custom header you are responsible
-# for the proper inclusion of any scripts and style sheets that doxygen
-# needs, which is dependent on the configuration options used.
-# It is advised to generate a default header using "doxygen -w html
-# header.html footer.html stylesheet.css YourConfigFile" and then modify
-# that header. Note that the header is subject to change so you typically
-# have to redo this when upgrading to a newer version of doxygen or when
-# changing the value of configuration settings such as GENERATE_TREEVIEW!
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If left blank doxygen will
-# generate a default style sheet. Note that it is recommended to use
-# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
-# tag will in the future become obsolete.
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
-# user-defined cascading style sheet that is included after the standard
-# style sheets created by doxygen. Using this option one can overrule
-# certain style aspects. This is preferred over using HTML_STYLESHEET
-# since it does not replace the standard style sheet and is therefor more
-# robust against future updates. Doxygen will copy the style sheet file to
-# the output directory.
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
-# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that
-# the files will be copied as-is; there are no commands or markers available.
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the style sheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 200
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 100
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = YES
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
-# entries shown in the various tree structured indices initially; the user
-# can expand and collapse entries dynamically later on. Doxygen will expand
-# the tree to such a level that at most the specified number of entries are
-# visible (unless a fully collapsed tree already exceeds this amount).
-# So setting the number of entries 1 will produce a full collapsed tree by
-# default. 0 is a special value representing an infinite number of entries
-# and will result in a full expanded tree by default.
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
-# identify the documentation publisher. This should be a reverse domain-name
-# style string, e.g. com.mycompany.MyDocSet.documentation.
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = org.doxygen.Project
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
-# Qt Help Project / Custom Filters</a>.
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
-# Qt Help Project / Filter Attributes</a>.
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
-# at top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it. Since the tabs have the same information as the
-# navigation tree you can set this option to NO if you already set
-# GENERATE_TREEVIEW to YES.
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-# Since the tree basically has the same information as the tab index you
-# could consider to set DISABLE_INDEX to NO when enabling this option.
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = YES
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
-# (range [0,1..20]) that doxygen will group on one line in the generated HTML
-# documentation. Note that a value of 0 will completely suppress the enum
-# values from appearing in the overview section.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 250
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
-# (see http://www.mathjax.org) which uses client side Javascript for the
-# rendering instead of using prerendered bitmaps. Use this if you do not
-# have LaTeX installed or if you want to formulas look prettier in the HTML
-# output. When enabled you may also need to install MathJax separately and
-# configure the path to it using the MATHJAX_RELPATH option.
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
-# thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
-# SVG. The default value is HTML-CSS, which is slower, but has the best
-# compatibility.
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
-# When MathJax is enabled you need to specify the location relative to the
-# HTML output directory using the MATHJAX_RELPATH option. The destination
-# directory should contain the MathJax.js script. For instance, if the mathjax
-# directory is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to
-# the MathJax Content Delivery Network so you can quickly see the result without
-# installing MathJax.
-# However, it is strongly recommended to install a local
-# copy of MathJax from http://www.mathjax.org before deployment.
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
-# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
-# names that should be enabled during MathJax rendering.
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript.
-# There are two flavours of web server based search depending on the
-# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
-# searching and an index file used by the script. When EXTERNAL_SEARCH is
-# enabled the indexing and searching needs to be provided by external tools.
-# See the manual for details.
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
-# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain
-# the search results. Doxygen ships with an example indexer (doxyindexer) and
-# search engine (doxysearch.cgi) which are based on the open source search engine
-# library Xapian. See the manual for configuration details.
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will returned the search results when EXTERNAL_SEARCH is enabled.
-# Doxygen ships with an example search engine (doxysearch) which is based on
-# the open source search engine library Xapian. See the manual for configuration
-# details.
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
-# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id
-# of to a relative location where the documentation can be found.
-# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
GENERATE_LATEX = NO
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, letter, legal and
-# executive. If left blank a4wide will be used.
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
-# the generated latex document. The footer should contain everything after
-# the last chapter. If it is left blank doxygen will generate a
-# standard footer. Notice: only use this tag if you know what you are doing!
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = YES
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = YES
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
-# http://en.wikipedia.org/wiki/BibTeX for more info.
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
-# Load style sheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
#---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
GENERATE_XML = NO
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
-XML_SCHEMA =
+XML_PROGRAMLISTING = YES
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
-XML_DTD =
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
+GENERATE_DOCBOOK = NO
-XML_PROGRAMLISTING = YES
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sf.net) file that captures the
+# structure of the code including all documentation. Note that this feature is
+# still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
+# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
@@ -1589,106 +2000,129 @@ PERLMOD_MAKEVAR_PREFIX =
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = NO
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# pointed to by INCLUDE_PATH will be searched when a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition that
-# overrules the definition found in the source code.
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all references to function-like macros
-# that are alone on a line, have an all uppercase name, and do not end with a
-# semicolon, because these will confuse the parser if not removed.
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::additions related to external references
+# Configuration options related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles. For each
-# tag file the location of the external documentation should be added. The
-# format of a tag file without this location is as follows:
-#
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
-#
# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths
-# or URLs. Note that each tag file must have a unique name (where the name does
-# NOT include the path). If a tag file is not located in the directory in which
-# doxygen is run, you must also specify the path to the tagfile here.
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
EXTERNAL_GROUPS = YES
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
@@ -1696,222 +2130,308 @@ PERL_PATH = /usr/bin/perl
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option also works with HAVE_DOT disabled, but it is recommended to
-# install and use dot, since it yields more powerful graphs.
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: YES.
HAVE_DOT = YES
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = 0
-# By default doxygen will use the Helvetica font for all dot files that
-# doxygen generates. When you want a differently looking font you can specify
-# the font name using DOT_FONTNAME. You need to make sure dot is able to find
-# the font, which can be done by putting it in a standard location or by setting
-# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
-# directory containing the font.
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the Helvetica font.
-# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
-# set the path where dot can find it.
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# CLASS_DIAGRAMS tag to NO.
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside
-# the class node. If there are many fields or methods and many nodes the
-# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
-# threshold limits the number of items for each type to make the size more
-# managable. Set this to 0 for no limit. Note that the threshold may be
-# exceeded by 50% before the limit is enforced.
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
UML_LIMIT_NUM_FIELDS = 10
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = YES
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = YES
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will generate a graphical hierarchy of all classes instead of a textual one.
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are svg, png, jpg, or gif.
-# If left blank png will be used. If you choose svg you need to set
-# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible in IE 9+ (other browsers do not have this requirement).
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,
+# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,
+# gif:cairo:gd, gif:gd, gif:gd:gd and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
-# Note that this requires a modern browser other than Internet Explorer.
-# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
-# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible. Older versions of IE do not have SVG support.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = YES
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the
-# \mscfile command).
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
MSCFILE_DIRS =
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = YES
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
diff --git a/LICENSE b/LICENSE
index 54d44277e4..0a2b1298bc 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014 Ford Motor Company,
+Copyright (c) 2017 SmartDeviceLink Consortium, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-* Neither the name of Ford Motor Company nor the names of its
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
@@ -24,4 +24,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
index 7236bd7c6b..f7a0f6763f 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,7 @@ Pull Requests Welcome!
* [Transport Manager Programming Guide](https://smartdevicelink.com/en/guides/core/transport-manager-programming/)
* [Software Detailed Design](https://app.box.com/s/ohgrvemtx39f8hfea1ab676xxrzvyx1y)
* [Integration Guidelines](https://smartdevicelink.com/en/docs/hmi/master/overview/)
+ * [Evolution Proposals versus Issues](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals_versus_issues.md)
## SDL Core
@@ -41,16 +42,14 @@ A quick guide to installing, configuring, and running an instance of the SDL Cor
```
%make
%make install
-%cp bin/mykey.pem src/appMain
-%cp bin/mycert.pem src/appMain
```
## Start SDL Core
Once SDL Core is compiled and installed you can start it from the executable in the bin folder
```
-%cd src/appMain
-%./smartDeviceLinkCore
+%cd bin/
+%./start.sh
```
## Start WEB HMI
@@ -74,6 +73,11 @@ The dependencies for SDL Core vary based on the configuration. You can change SD
|Testing framework|Needed to support running unit tests|libgtest-dev|
|Cmake|Needed to configure SDL prior to compilation|cmake|
+#### Sample Policy Manager
+The included sample policy manager (for use with `EXTERNAL_PROPRIETARY` policy mode) requires the following packages:
+ - python-pip
+ - python-dev
+
### Known Dependency Issues
* log4cxx - We know that the version of log4cxx on a linux machine can conflict with the one used, which is why it is provided in the repository. To avoid the conflict, we recommend removing liblog4cxx*.
* cmake - on some versions of linux, the included cmake package doesn't have the right version. If apt-get is your package manager, you can find the correct version using
diff --git a/cmake/Modules/FindSqlite3.cmake b/cmake/Modules/FindSqlite3.cmake
deleted file mode 100644
index 514ff0b7f9..0000000000
--- a/cmake/Modules/FindSqlite3.cmake
+++ /dev/null
@@ -1,81 +0,0 @@
-# - Try to find Sqlite3
-# Once done this will define
-#
-# SQLITE3_FOUND - system has Sqlite3
-# SQLITE3_INCLUDE_DIRS - the Sqlite3 include directory
-# SQLITE3_LIBRARIES - Link these to use Sqlite3
-# SQLITE3_DEFINITIONS - Compiler switches required for using Sqlite3
-#
-# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
-#
-# Redistribution and use is allowed according to the terms of the New
-# BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-
-if (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
- set(SQLITE3_FOUND TRUE)
-else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
- find_package(PkgConfig)
- if (PKG_CONFIG_FOUND)
- pkg_check_modules(_SQLITE3 REQUIRED sqlite3>=3.7.11)
- else (PKG_CONFIG_FOUND)
- message(WARNING "PkgConfig isn't installed. You need to sure sqlite3>=3.7.11")
- endif (PKG_CONFIG_FOUND)
-
- find_path(SQLITE3_INCLUDE_DIR
- NAMES
- sqlite3.h
- PATHS
- ${_SQLITE3_INCLUDEDIR}
- /usr/include
- /usr/local/include
- /opt/local/include
- /sw/include
- )
-
- find_library(SQLITE3_LIBRARY
- NAMES
- sqlite3
- PATHS
- ${_SQLITE3_LIBDIR}
- /usr/lib
- /usr/local/lib
- /opt/local/lib
- /sw/lib
- )
-
- if (SQLITE3_LIBRARY)
- set(SQLITE3_FOUND TRUE)
- endif (SQLITE3_LIBRARY)
-
- set(SQLITE3_INCLUDE_DIRS
- ${SQLITE3_INCLUDE_DIR}
- )
-
- if (SQLITE3_FOUND)
- set(SQLITE3_LIBRARIES
- ${SQLITE3_LIBRARIES}
- ${SQLITE3_LIBRARY}
- )
- endif (SQLITE3_FOUND)
-
- if (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
- set(SQLITE3_FOUND TRUE)
- endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
-
- if (SQLITE3_FOUND)
- if (NOT Sqlite3_FIND_QUIETLY)
- message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES}")
- endif (NOT Sqlite3_FIND_QUIETLY)
- else (SQLITE3_FOUND)
- if (Sqlite3_FIND_REQUIRED)
- message(FATAL_ERROR "Could not find Sqlite3")
- endif (Sqlite3_FIND_REQUIRED)
- endif (SQLITE3_FOUND)
-
- # show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view
- mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
-
-endif (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) \ No newline at end of file
diff --git a/docs/FORD.OpenSDL.SDD.TPL.dox b/docs/FORD.OpenSDL.SDD.TPL.dox
new file mode 100644
index 0000000000..c0106df5d4
--- /dev/null
+++ b/docs/FORD.OpenSDL.SDD.TPL.dox
@@ -0,0 +1,355 @@
+/**
+\cond FALSE
+------ Design document template explanation -------
+This is a SW Detailed Design template for each SDl component update.
+The original QCA template with more detail description is available at Luxoft portal
+https://adc.luxoft.com/confluence/display/PORTAL/Software+Detailed+Design+Template
+
+---------------------- HOWTO -----------------------
+For adding new component documentation please follow this steps:
+1. Copy this document to the 'doc' subdirectory in the Component working directory with a new name
+ - Example:
+ + src/components/transport_manager/docs/FORD.OpenSDL.SDD.TM.dox
+ + src/components/utils/docs/FORD.OpenSDL.SDD.Utils.dox
+ - https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentNaming
+2. Replace <!Component Name> with a correct naming according to SAD naming
+ - Name examples:
+ Application Manager, Connection Handler
+ - Replace examples:
+ ~ sed -i 's/<!Component Name>/Utils/g' FORD.OpenSDL.SDD.Utils.dox
+3. Replace <!Component_Id> with a shot unique name
+ - Something like app_manage, connection_handler, policy
+ - It shall be one word without spaces and special symbols except '_'
+ - Replace examples:
+ ~ sed -i 's/<!Component_Id>/connection_handler/g' FORD.OpenSDL.SDD.Utils.dox
+ Note: After that step all Doxygen tags becomes working well and IDE could be used
+4. Add reference in mainpage.dox Table of Content using <!Component_Id> used in p.3
+5. Replace blocks marked as following with a content according to instructions in these blocks
+ - Each block starts as <!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+ - Each block ends as <!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
+ - If chapter content is not applicable for a Component update it with "Not applicable, since/because of <Reason>."
+6. Update source code doxygen comments for mentioning entities in the following SDD chapter:
+ - Public and private interfaces from chapter 3
+ - Data types from chapter 4.2
+7. Update project Doxygen file with path to new images
+ * IMAGE_PATH parameter
+8. Remove this template explanation from cond to endcond tags
+
+General notes/reminders:
+- Commit both: images and them source to the git repository
+- SDD file extension shall be 'dox'
+- the preferable path for SDD is src/components/COMPONENT/docs
+- the preferable path for SDD images is src/components/COMPONENT/docs/assets
+
+For more information, please follow:
+- Doxygen documentation
+ http://www.stack.nl/~dimitri/doxygen/manual/index.html
+- Markdown support by doxygen
+ http://www.stack.nl/~dimitri/doxygen/manual/markdown.html
+- Text-base UML tool
+ http://plantuml.com/
+- Article "Providing design documentation with code changes"
+ https://github.com/smartdevicelink/sdl_core/wiki/Providing-design-documentation-with-code-changes
+
+---------------------------------------------
+\endcond
+\page <!Component_Id> <!Component Name> Detailed Design
+## Table of contents
+- \subpage <!Component_Id>_intoduction
+ + \ref <!Component_Id>_rationale "1.1 Rationale"
+ + \ref <!Component_Id>_scope "1.2 Scope"
+ + \ref <!Component_Id>_abbreviations "1.3 Abbreviations"
+- \subpage <!Component_Id>_detail_design
+ + \ref <!Component_Id>_design_solutions "2.1 Design solutions"
+ + \ref <!Component_Id>_class_structure "2.2 Class Structure"
+ + \ref <!Component_Id>_sequence_diagram "2.3 Sequence diagram"
+ + \ref <!Component_Id>_state_chart "2.4 State chart diagram"
+- \subpage <!Component_Id>_interfaces
+ + \ref <!Component_Id>_public_interfaces "3.1 Public interfaces description"
+ + \ref <!Component_Id>_internal_interfaces "3.2 Internal interfaces description"
+ + \ref <!Component_Id>_derived_interfaces "3.3 Derived interfaces and dependencies"
+- \subpage <!Component_Id>_data_structure_resources
+ + \ref <!Component_Id>_data_structure "4.1 Element Data Structure"
+ + \ref <!Component_Id>_resources "4.2 Resource usage"
+- \subpage <!Component_Id>_references_and_history
+ + \ref <!Component_Id>_references "5.1 References"
+ + \ref <!Component_Id>_history "5.2 Document history change and approve"
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_intoduction 1. Introduction
+The document is intended to support software developers,
+maintenance and integration engineers with sufficient,
+detailed information concerning the design, development and
+deployment concepts, to accomplish their respective tasks without reliance on the authors.
+
+\anchor <!Component_Id>_rationale
+## 1.1 Rationale
+<!Component Name> implements SDL Architectural Solution according to:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be a link SAD Components View and Requirements if applicable)
+Example:
+ https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#hmi-message-handler
+<!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_scope
+## 1.2 Scope
+<!Component Name> extracted as a separate component for
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a reason and short description of the components functionality
+Example:
+ Security Manager component extracted as a separate module for
+ Ford channel data protection.
+ This components is used to :
+ - Provide security communications
+ - Protect income and outcome business layer data from interception
+ - Verify the relation between a mobile application certificate and its owner
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_abbreviations
+## 1.3 Abbreviations
+Abbreviations used in this document please find in the table below.
+| Abbreviation | Expansion |
+|------------------|----------------------------------|
+| | |
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all component-specific terms, as
+| TA | Transport Adapter |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+Definitions used in this document are in the table below.
+
+| Definition | Description |
+|------------------|-----------------------------------|
+| | |
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all component-specific terms, as
+| WebSocket | a protocol providing full-duplex communication channels over a single TCP connection |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_detail_design 2. Component detail design
+\anchor <!Component_Id>_design_solutions
+### 2.1 Design solutions
+The following design approaches and pattern was used for <!Component Name>:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added GoF (or other) SW design patterns,
+technologies and approaches with short description
+Example:
+ - Command design pattern is used to treat requests as an object that provides
+ possibility to add new request without existing code modification
+ - Factory method pattern design used for SSLContext objects creation
+ + It also guaranty correctness of SSLContext destruction by the
+ same Compiled SecurityManger object
+ - All database reading are cached by CacheManager class, which
+ guaranty meeting timing contrariness
+ - SQLite database was chosen as a lightweight, embedded, transactional SQL database engine
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_class_structure
+### 2.2 Class Structure
+The following UML class digram shows the component classes structure.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added class diagram
+Example:
+ ![Security Manager class diagram](sm_class_digram.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy digram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/classes.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about class digram follow:
+- http://www.uml-diagrams.org/class-diagrams-overview.html
+- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
+
+\anchor <!Component_Id>_sequence_diagram
+### 2.3 Sequence diagram
+The following UML sequence digram shows how objects operate with one another and in what order.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added sequence diagram
+Example:
+ Short description
+ ![Connection](connection.png)
+ ![job](job.png)
+ ![disconnection](disconnection.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy digram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/sequence.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about sequence digram follow:
+- http://www.uml-diagrams.org/sequence-diagrams.html
+- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
+
+\anchor <!Component_Id>_state_chart
+### 2.4 State chart diagram
+The following UML state digram shows the component life cycle states.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added state diagram
+Example:
+ ![StateControllerImpl state](state_contoroller_states.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy digram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/state.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about class digram follow:
+- http://www.uml-diagrams.org/state-machine-diagrams.html
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_interfaces 3. Component Interfaces
+\anchor <!Component_Id>_public_interfaces
+### 3.1 Public interfaces description
+<!Component Name> provides functionality with following interfaces:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of external interfaces
+Example:
+ - security_manager::SecurityManager
+ - security_manager::SecurityManagerListener
+ - security_manager::SSLContext
+(!) All link will be auto-added by doxygen
+For more auto-linking follow - https://www.stack.nl/~dimitri/doxygen/manual/autolink.html#linkclass
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_internal_interfaces
+### 3.2 Internal interfaces description
+The following interfaces are provided by component for internal usage only:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of internal interfaces
+Example:
+ - security_manager::CryptoManager
+ - security_manager::CryptoManagerSettings
+ - security_manager::SecurityQuery
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_derived_interfaces
+### 3.3 Derived interfaces and dependencies
+<!Component Name> required following 3d-party libraries:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of libraries
+Example:
+ - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+The following interfaces are required by component:
+- \ref src/components/include/utils Utils
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of external interfaces
+Example:
+ - protocol_handler::ProtocolObserver for getting Protocol notifications
+ - implements protocol_handler::SessionObserver for providing SSLContext object managing
+ - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) :
+ + SSL_library_init() - registers the available SSL/TLS ciphers and digests.
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_data_structure_resources 4. Component data and resources
+\anchor <!Component_Id>_data_structure
+### 4.1 Element Data Structure
+The following data types are used by the Component:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of component data types
+Example:
+ - security_manager::SecurityQuery
+ - protocol_handler::ProtocolPacket
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+The format of processing/saving/loading data is:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of formats
+Example:
+ - Json data according to APPLINK-19421
+ - Binary data array according to Ford Protocol Specification
+ + https://github.com/smartdevicelink/protocol_spec
+ - PEM certificates according to APPLINK-21512
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_resources
+### 4.2 Resource usage
+The following system resources are used by the Component:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all resource-related information
+All file, database or network reading
+An amount of processing by component data
+Example:
+ Resumption uses QBD/JSON database with configurable limitation 10 Mb
+ Request Controller Handle a configured amount of RPCs:
+ - A XXX count of messages from application in NONE level
+ + <LINK_TO_REQURMENT_XXX>
+ - A YYY count of messages per second for each application
+ + <LINK_TO_REQURMENT_YYY>
+ (!) In case of no such restrict it need to be clarified (!)
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_references_and_history 5. References and history
+\anchor <!Component_Id>_references
+### 5.1 References
+- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of all related to component functionality
+references, including 3d-party libraries, documentation, requirements
+Example:
+ - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+ - [SQLite Documents](https://www.sqlite.org/docs.html)
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_history
+### 5.2 Document history
+Document change history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example:
+| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
+For more details follow
+https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentVersion
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+Document approve history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example:
+| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more precise document change history follow github history -
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example for this template:
+- https://github.com/smartdevicelink/sdl_core/commits/master/docs/software_detailed_design_template.dox
+- https://github.com/smartdevicelink/sdl_core/commits/develop/docs/software_detailed_design_template.dox
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/ \ No newline at end of file
diff --git a/docs/mainpage.dox b/docs/mainpage.dox
new file mode 100644
index 0000000000..91ee95fc26
--- /dev/null
+++ b/docs/mainpage.dox
@@ -0,0 +1,11 @@
+/**
+ * \mainpage Software Detail Design Documentation
+ *
+ * This documents contain SW detailed design information fro each [SmartDeviceLink component](https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/).
+ *
+ * For getting SmartDeviceLink overview, please, refer to [Software Architecture Document](https://smartdevicelink.com/en/docs/core/master/software-architecture-document/table-of-contents/)
+ *
+ * ##Table of contents
+ * - \ref security_manager
+ */
+ //-----------------------------------------------------------
diff --git a/src/3rd_party-static/CMakeLists.txt b/src/3rd_party-static/CMakeLists.txt
index 8dfcf6595a..2acd7be27c 100644
--- a/src/3rd_party-static/CMakeLists.txt
+++ b/src/3rd_party-static/CMakeLists.txt
@@ -32,8 +32,8 @@
add_subdirectory(./jsoncpp)
set(JSONCPP_INCLUDE_DIRECTORY ${JSONCPP_INCLUDE_DIRECTORY} PARENT_SCOPE)
-# --- MessageBroker
-add_subdirectory(./MessageBroker)
+# --- Message Broker
+add_subdirectory(./message_broker)
set(MESSAGE_BROKER_INCLUDE_DIRECTORY ${MESSAGE_BROKER_INCLUDE_DIRECTORY} PARENT_SCOPE)
# --- encryption
@@ -48,6 +48,9 @@ if (BUILD_USB_SUPPORT)
endif()
endif()
+# --- gmock
if(BUILD_TESTS)
+ add_subdirectory(./gmock-1.7.0)
+ set(GMOCK_INCLUDE_DIRECTORY ${GMOCK_INCLUDE_DIRECTORY} PARENT_SCOPE)
add_subdirectory(test)
endif()
diff --git a/src/3rd_party-static/MessageBroker/CMakeLists.txt b/src/3rd_party-static/MessageBroker/CMakeLists.txt
deleted file mode 100644
index 87a0fe2a2a..0000000000
--- a/src/3rd_party-static/MessageBroker/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-set(MESSAGE_BROKER_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include)
-set(MESSAGE_BROKER_INCLUDE_DIRECTORY ${MESSAGE_BROKER_INCLUDE_DIRECTORY} PARENT_SCOPE)
-
-include_directories (
- ./include/
- ../jsoncpp/include
- ../../components/utils/include
-
-)
-
-set (MESSAGE_BROKER_SOURCES
- ./src/lib_messagebroker/CMessageBroker.cpp
- ./src/lib_messagebroker/CMessageBrokerRegistry.cpp
- ./src/lib_messagebroker/md5.cpp
- ./src/lib_messagebroker/system.cpp
- ./src/lib_messagebroker/websocket_handler.cpp
-)
-
-set (MESSAGE_BROKER_CLIENT_SOURCES
- ./src/client/mb_client.cpp
- ./src/client/mb_tcpclient.cpp
- ./src/client/mb_controller.cpp
-)
-
-set (MESSAGE_BROKER_SERVER_SOURCES
- ./src/server/mb_server.cpp
- ./src/server/mb_tcpserver.cpp
- ./src/server/networking.cpp
-)
-
-add_library("MessageBroker" ${MESSAGE_BROKER_SOURCES})
-target_link_libraries(MessageBroker Utils)
-
-
-add_library("MessageBrokerClient" ${MESSAGE_BROKER_CLIENT_SOURCES})
-target_link_libraries("MessageBrokerClient" "MessageBroker")
-
-add_library("MessageBrokerServer" ${MESSAGE_BROKER_SERVER_SOURCES})
-target_link_libraries("MessageBrokerServer" "MessageBroker")
diff --git a/src/3rd_party-static/encryption/CMakeLists.txt b/src/3rd_party-static/encryption/CMakeLists.txt
index 3802c83cb5..5096f59c22 100644
--- a/src/3rd_party-static/encryption/CMakeLists.txt
+++ b/src/3rd_party-static/encryption/CMakeLists.txt
@@ -1,14 +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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
set(ENCRYPTION_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(ENCRYPTION_INCLUDE_DIRECTORY ${ENCRYPTION_INCLUDE_DIRECTORY} PARENT_SCOPE)
include_directories (
- ./include
+ ${ENCRYPTION_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ./src/Base64.cpp
- ./src/hashing.cc
-)
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
set (LIBRARIES crypto)
diff --git a/src/3rd_party-static/gmock-1.7.0/include/gmock/gmock-spec-builders.h b/src/3rd_party-static/gmock-1.7.0/include/gmock/gmock-spec-builders.h
index ec7a9bd000..17d223dcde 100644
--- a/src/3rd_party-static/gmock-1.7.0/include/gmock/gmock-spec-builders.h
+++ b/src/3rd_party-static/gmock-1.7.0/include/gmock/gmock-spec-builders.h
@@ -418,12 +418,6 @@ class GTEST_API_ Mock {
static bool VerifyAndClear(void* mock_obj)
GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
- // Asynchronously verifies all expectations of all registered mock objects
- // and clears there default actions and expectations. Returns true if the
- // verification was successful.
- static bool AsyncVerifyAndClearExpectations(int timeout)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
-
private:
friend class internal::UntypedFunctionMockerBase;
@@ -473,12 +467,6 @@ class GTEST_API_ Mock {
static bool VerifyAndClearExpectationsLocked(void* mock_obj)
GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
- // Asynchronously verifies that all expectations of all registered
- // mock objects have been satisfied. Reports one or more Google
- // Test non-fatal failures and returns false if not.
- static bool AsyncVerifyAndClearExpectationsLocked(int timeout_msec)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
-
// Clears all ON_CALL()s set on the given mock object.
static void ClearDefaultActionsLocked(void* mock_obj)
GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
diff --git a/src/3rd_party-static/gmock-1.7.0/src/gmock-spec-builders.cc b/src/3rd_party-static/gmock-1.7.0/src/gmock-spec-builders.cc
index 1219a3a3c9..3943d09276 100644
--- a/src/3rd_party-static/gmock-1.7.0/src/gmock-spec-builders.cc
+++ b/src/3rd_party-static/gmock-1.7.0/src/gmock-spec-builders.cc
@@ -755,108 +755,6 @@ bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)
return expectations_met;
}
-bool Mock::AsyncVerifyAndClearExpectations(int timeout_msec)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- return AsyncVerifyAndClearExpectationsLocked(timeout_msec);
-}
-
-bool Mock::AsyncVerifyAndClearExpectationsLocked(const int timeout_msec_in)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
- internal::g_gmock_mutex.AssertHeld();
- MockObjectRegistry::StateMap& state_map = g_mock_object_registry.states();
- if (state_map.empty()) {
- // No EXPECT_CALL() was set on the given mock object.
- return true;
- }
-
- // TODO(ezamakhov@gmail.com): refactor the next loops
- bool expectations_met = true;
- timeval first_register_time {0, 0};
- int timeout_msec = timeout_msec_in;
- for (MockObjectRegistry::StateMap::iterator mock_it = state_map.begin();
- state_map.end() != mock_it; ++mock_it) {
- MockObjectState& state = mock_it->second;
-
- // Verifies the expectations on each mock method in the
- // given mock object.
- FunctionMockers& mockers = state.function_mockers;
- if (mockers.empty()) {
- internal::Assert(!mockers.empty(), __FILE__, __LINE__,
- "No functions mocked");
- return true;
- }
-
- for (FunctionMockers::const_iterator it = mockers.begin();
- it != mockers.end(); ++it) {
- internal::UntypedFunctionMockerBase* base = *it;
-
- const timeval register_time = base->RegisteredTime();
- if (!timerisset(&first_register_time) ||
- timercmp(&register_time, &first_register_time, <)) {
- first_register_time = register_time;
- }
-
- // Waiting expectations loop
- do {
- const internal::ExpectationResult result =
- base->VerifyExpectationsLocked();
- if (result == internal::OverSaturated) {
- expectations_met = false;
- // break waiting procedure
- break;
- }
- if (result == internal::Satisfied) {
- // break waiting procedure
- break;
- }
- if (result == internal::NotSatisfied) {
- // If timeout expared
- if (timeout_msec <= 0) {
- expectations_met = false;
- // break waiting procedure
- break;
- }
- // Unlock callbacks procedures
- static const int sleep_msec = 10;
- internal::UnlockAndSleep(sleep_msec * 1000);
- timeout_msec -= sleep_msec;
- }
- } while (true);
- } // mockers iteration
-
- if (expectations_met) {
- const long elapsed_usecs =
- // first_register_time is empty on no expectations in mocks
- timerisset(&first_register_time)
- ? internal::UsecsElapsed(first_register_time)
- : 100 * 1000;
- // To avoid waitings very long times.
- const long max_sleep_time = timeout_msec_in * 10 * 1000;
- if (max_sleep_time > elapsed_usecs * 2) {
- // Wait double times
- internal::UnlockAndSleep(elapsed_usecs * 2);
- }
- }
-
- // Verifies and clears the expectations on each mock method in the
- // given mock object.
- for (FunctionMockers::const_iterator it = mockers.begin();
- it != mockers.end(); ++it) {
- internal::UntypedFunctionMockerBase* base = *it;
- // Get finial result and clear expectation
- const bool final_verification = base->VerifyAndClearExpectationsLocked();
- if (!final_verification) {
- expectations_met = false;
- }
- }
- } // state_map iteration
-
- // We don't clear the content of mockers, as they may still be
- // needed by ClearDefaultActionsLocked().
- return expectations_met;
-}
-
// Registers a mock object and a mock method it owns.
void Mock::Register(const void* mock_obj,
internal::UntypedFunctionMockerBase* mocker)
diff --git a/src/3rd_party-static/jsoncpp/CMakeLists.txt b/src/3rd_party-static/jsoncpp/CMakeLists.txt
index 04a4bd960c..ac273cfe7b 100644
--- a/src/3rd_party-static/jsoncpp/CMakeLists.txt
+++ b/src/3rd_party-static/jsoncpp/CMakeLists.txt
@@ -1,14 +1,42 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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)
+
set(JSONCPP_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(JSONCPP_INCLUDE_DIRECTORY ${JSONCPP_INCLUDE_DIRECTORY} PARENT_SCOPE)
-include_directories (
- ./include/
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
)
-set (SOURCES
- ./src/lib_json/json_value.cpp
- ./src/lib_json/json_writer.cpp
- ./src/lib_json/json_reader.cpp
-)
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/lib_json")
-add_library("jsoncpp" ${SOURCES})
+add_library(jsoncpp ${SOURCES})
diff --git a/src/3rd_party-static/message_broker/CMakeLists.txt b/src/3rd_party-static/message_broker/CMakeLists.txt
new file mode 100644
index 0000000000..348d050887
--- /dev/null
+++ b/src/3rd_party-static/message_broker/CMakeLists.txt
@@ -0,0 +1,78 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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)
+
+set(MESSAGE_BROKER_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include)
+set(MESSAGE_BROKER_INCLUDE_DIRECTORY ${MESSAGE_BROKER_INCLUDE_DIRECTORY} PARENT_SCOPE)
+
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+)
+
+set(CLIENT_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/client
+)
+collect_sources(CLIENT_SOURCES "${CLIENT_PATHS}")
+
+set(SERVER_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/server
+)
+collect_sources(SERVER_SOURCES "${SERVER_PATHS}")
+
+set(EXCLUDE_PATHS
+ ${CLIENT_PATHS}
+ ${SERVER_PATHS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/example
+)
+
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+
+set(LIBRARIES
+ Utils
+)
+
+add_library(message_broker ${SOURCES})
+target_link_libraries(message_broker ${LIBRARIES})
+
+list(APPEND LIBRARIES
+ message_broker
+)
+
+add_library(message_broker_client ${CLIENT_SOURCES})
+target_link_libraries(message_broker_client ${LIBRARIES})
+
+add_library(message_broker_server ${SERVER_SOURCES})
+target_link_libraries(message_broker_server ${LIBRARIES})
diff --git a/src/3rd_party-static/MessageBroker/include/CMessageBroker.hpp b/src/3rd_party-static/message_broker/include/CMessageBroker.hpp
index c542043796..c542043796 100644
--- a/src/3rd_party-static/MessageBroker/include/CMessageBroker.hpp
+++ b/src/3rd_party-static/message_broker/include/CMessageBroker.hpp
diff --git a/src/3rd_party-static/MessageBroker/include/CMessageBrokerRegistry.hpp b/src/3rd_party-static/message_broker/include/CMessageBrokerRegistry.hpp
index 001f978bbf..001f978bbf 100644
--- a/src/3rd_party-static/MessageBroker/include/CMessageBrokerRegistry.hpp
+++ b/src/3rd_party-static/message_broker/include/CMessageBrokerRegistry.hpp
diff --git a/src/3rd_party-static/MessageBroker/include/CSender.hpp b/src/3rd_party-static/message_broker/include/CSender.hpp
index 78faf7dad2..78faf7dad2 100644
--- a/src/3rd_party-static/MessageBroker/include/CSender.hpp
+++ b/src/3rd_party-static/message_broker/include/CSender.hpp
diff --git a/src/3rd_party-static/MessageBroker/include/MBDebugHelper.h b/src/3rd_party-static/message_broker/include/MBDebugHelper.h
index fa835da3f0..fa835da3f0 100644
--- a/src/3rd_party-static/MessageBroker/include/MBDebugHelper.h
+++ b/src/3rd_party-static/message_broker/include/MBDebugHelper.h
diff --git a/src/3rd_party-static/MessageBroker/include/mb_client.hpp b/src/3rd_party-static/message_broker/include/mb_client.hpp
index cd70a31cd8..cd70a31cd8 100644
--- a/src/3rd_party-static/MessageBroker/include/mb_client.hpp
+++ b/src/3rd_party-static/message_broker/include/mb_client.hpp
diff --git a/src/3rd_party-static/MessageBroker/include/mb_controller.hpp b/src/3rd_party-static/message_broker/include/mb_controller.hpp
index 2d196aced2..2d196aced2 100644
--- a/src/3rd_party-static/MessageBroker/include/mb_controller.hpp
+++ b/src/3rd_party-static/message_broker/include/mb_controller.hpp
diff --git a/src/3rd_party-static/MessageBroker/include/mb_server.hpp b/src/3rd_party-static/message_broker/include/mb_server.hpp
index 684a89055a..684a89055a 100644
--- a/src/3rd_party-static/MessageBroker/include/mb_server.hpp
+++ b/src/3rd_party-static/message_broker/include/mb_server.hpp
diff --git a/src/3rd_party-static/MessageBroker/include/mb_tcpclient.hpp b/src/3rd_party-static/message_broker/include/mb_tcpclient.hpp
index 07697dbde7..07697dbde7 100644
--- a/src/3rd_party-static/MessageBroker/include/mb_tcpclient.hpp
+++ b/src/3rd_party-static/message_broker/include/mb_tcpclient.hpp
diff --git a/src/3rd_party-static/MessageBroker/include/mb_tcpserver.hpp b/src/3rd_party-static/message_broker/include/mb_tcpserver.hpp
index 8ab2ce6a6d..8ab2ce6a6d 100644
--- a/src/3rd_party-static/MessageBroker/include/mb_tcpserver.hpp
+++ b/src/3rd_party-static/message_broker/include/mb_tcpserver.hpp
diff --git a/src/3rd_party-static/MessageBroker/include/networking.h b/src/3rd_party-static/message_broker/include/networking.h
index a08853bb31..a08853bb31 100644
--- a/src/3rd_party-static/MessageBroker/include/networking.h
+++ b/src/3rd_party-static/message_broker/include/networking.h
diff --git a/src/3rd_party-static/MessageBroker/include/system.h b/src/3rd_party-static/message_broker/include/system.h
index fac4f7926b..fac4f7926b 100644
--- a/src/3rd_party-static/MessageBroker/include/system.h
+++ b/src/3rd_party-static/message_broker/include/system.h
diff --git a/src/3rd_party-static/MessageBroker/include/websocket_handler.hpp b/src/3rd_party-static/message_broker/include/websocket_handler.hpp
index 8bed007436..8bed007436 100644
--- a/src/3rd_party-static/MessageBroker/include/websocket_handler.hpp
+++ b/src/3rd_party-static/message_broker/include/websocket_handler.hpp
diff --git a/src/3rd_party-static/MessageBroker/src/client/mb_client.cpp b/src/3rd_party-static/message_broker/src/client/mb_client.cpp
index 6342c776a8..6342c776a8 100644
--- a/src/3rd_party-static/MessageBroker/src/client/mb_client.cpp
+++ b/src/3rd_party-static/message_broker/src/client/mb_client.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/client/mb_controller.cpp b/src/3rd_party-static/message_broker/src/client/mb_controller.cpp
index 8a4a77cf30..8a4a77cf30 100644
--- a/src/3rd_party-static/MessageBroker/src/client/mb_controller.cpp
+++ b/src/3rd_party-static/message_broker/src/client/mb_controller.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/client/mb_tcpclient.cpp b/src/3rd_party-static/message_broker/src/client/mb_tcpclient.cpp
index 02db417c26..02db417c26 100644
--- a/src/3rd_party-static/MessageBroker/src/client/mb_tcpclient.cpp
+++ b/src/3rd_party-static/message_broker/src/client/mb_tcpclient.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerAVA.cpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.cpp
index 77ab1ca2c1..77ab1ca2c1 100644
--- a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerAVA.cpp
+++ b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerAVA.hpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.hpp
index 47e684a7e4..47e684a7e4 100644
--- a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerAVA.hpp
+++ b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.hpp
diff --git a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerBackend.cpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.cpp
index cbbe39492b..cbbe39492b 100644
--- a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerBackend.cpp
+++ b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerBackend.hpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.hpp
index b79411dc98..b79411dc98 100644
--- a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerBackend.hpp
+++ b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.hpp
diff --git a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerPhone.cpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.cpp
index 6f308e71c2..6f308e71c2 100644
--- a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerPhone.cpp
+++ b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerPhone.hpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.hpp
index e6f4898226..e6f4898226 100644
--- a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerControllerPhone.hpp
+++ b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.hpp
diff --git a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerServer.cpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.cpp
index 405b3fcbd5..405b3fcbd5 100644
--- a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerServer.cpp
+++ b/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerServer.hpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.hpp
index 884ed0309f..884ed0309f 100644
--- a/src/3rd_party-static/MessageBroker/src/example/MessageBrokerServer.hpp
+++ b/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.hpp
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBroker.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp
index 3b14489a8c..3b14489a8c 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBroker.cpp
+++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBrokerRegistry.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp
index fb24d08f1c..fb24d08f1c 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBrokerRegistry.cpp
+++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/libMBDebugHelper.h b/src/3rd_party-static/message_broker/src/lib_messagebroker/libMBDebugHelper.h
index 0d5260cdda..0d5260cdda 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/libMBDebugHelper.h
+++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/libMBDebugHelper.h
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/md5.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.cpp
index b3e347d9d7..b3e347d9d7 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/md5.cpp
+++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/md5.h b/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.h
index 2c54c03b1b..2c54c03b1b 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/md5.h
+++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.h
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/system.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/system.cpp
index 456362f9d8..456362f9d8 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/system.cpp
+++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/system.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/websocket_handler.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp
index 7d3890b7a8..7d3890b7a8 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/websocket_handler.cpp
+++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/server/mb_server.cpp b/src/3rd_party-static/message_broker/src/server/mb_server.cpp
index 25ec7fc9f3..25ec7fc9f3 100644
--- a/src/3rd_party-static/MessageBroker/src/server/mb_server.cpp
+++ b/src/3rd_party-static/message_broker/src/server/mb_server.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/server/mb_tcpserver.cpp b/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp
index bdd7b2bfdf..bdd7b2bfdf 100644
--- a/src/3rd_party-static/MessageBroker/src/server/mb_tcpserver.cpp
+++ b/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp
diff --git a/src/3rd_party-static/MessageBroker/src/server/networking.cpp b/src/3rd_party-static/message_broker/src/server/networking.cpp
index f054431690..f054431690 100644
--- a/src/3rd_party-static/MessageBroker/src/server/networking.cpp
+++ b/src/3rd_party-static/message_broker/src/server/networking.cpp
diff --git a/src/3rd_party-static/test/CMakeLists.txt b/src/3rd_party-static/test/CMakeLists.txt
index 33bcd82694..a38a392a01 100644
--- a/src/3rd_party-static/test/CMakeLists.txt
+++ b/src/3rd_party-static/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,21 +28,16 @@
# 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_directories(
${GMOCK_INCLUDE_DIRECTORY}
${JSONCPP_INCLUDE_DIRECTORY}
)
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+
set(LIBRARIES
gmock
jsoncpp
)
-set (SOURCES
- json_reader_test.cc
-)
-
-add_library("test_JSONCPPTest" ${SOURCES})
-create_test("test_JSONCPP" "${SOURCES}" "${LIBRARIES}")
-endif() \ No newline at end of file
+create_test(jsoncpp_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt
index c7965992f4..cddc2d16b6 100644
--- a/src/3rd_party/CMakeLists.txt
+++ b/src/3rd_party/CMakeLists.txt
@@ -28,7 +28,27 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-INCLUDE("./set_3rd_party_paths.cmake")
+include("./set_3rd_party_paths.cmake")
+
+set(3RD_PARTY_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+
+set (install-3rd_party_logger_var "")
+set (install-3rd_party_dbus_var "")
+
+if(NO_REBUILD_3RD_PARTY)
+ set(NO_REBUILD_3RD_PARTY_LOGGER ON)
+ set(NO_REBUILD_3RD_PARTY_DBUS ON)
+endif()
+
+if(FORCE_3RD_PARTY)
+ if(NO_REBUILD_3RD_PARTY)
+ message(FATAL_ERROR "Please don't turn on both FORCE_3RD_PARTY and NO_REBUILD_3RD_PARTY at the same time.")
+ else()
+ set(FORCE_3RD_PARTY_LOGGER ON)
+ set(FORCE_3RD_PARTY_DBUS ON)
+ endif()
+endif()
if(ENABLE_LOG OR HMI_DBUS_API)
# --- libexpat
@@ -37,14 +57,112 @@ if(ENABLE_LOG OR HMI_DBUS_API)
endif()
if(ENABLE_LOG)
+ if(NO_REBUILD_3RD_PARTY_LOGGER)
+ message(STATUS "Not rebuilding logger.")
+ else()
+ if(FORCE_3RD_PARTY_LOGGER)
+ message(STATUS "Force to rebuild logger.")
+
+ #build logger
+ add_custom_target(3rd_party_logger
+ make
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ #install logger
+ #install either to default place with sudo or non-default plase without sudo.
+ #to install with sudo to non-default place use manual installation
+ add_custom_target(install-3rd_party_logger
+ COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ sudo -k \;
+ sudo make install\;
+ else
+ make install\;
+ fi\"
+ DEPENDS 3rd_party_logger
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+ else()
+ #build logger
+ add_custom_target(3rd_party_logger
+ COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} &&
+ grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]\; then
+ VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\;
+ VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
+ VAR2=-1\;
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\;
+ fi\;
+ if [ \\$$VAR1 != \\$$VAR2 ]\; then
+ echo " Need to rebuild logger. " \;
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make\;
+ else
+ echo " Logger is actual. " \;
+ fi\;
+ else
+ echo " Need to build logger. " \;
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make\;
+ fi\"
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ #install logger
+ #install either to default place with sudo or non-default plase without sudo.
+ #to install with sudo to non-default place use manual installation
+ add_custom_target(install-3rd_party_logger
+ COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} &&
+ grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]\; then
+ VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\;
+ VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
+ VAR2=-1\;
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\;
+ fi\;
+ if [ \\$$VAR1 != \\$$VAR2 ]\; then
+ USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ sudo -k \;
+ sudo make install\;
+ else
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make install\;
+ fi\;
+ fi\;
+ else
+ USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ sudo -k \;
+ sudo make install\;
+ else
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make install\;
+ fi\;
+ fi\"
+ DEPENDS 3rd_party_logger
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+ endif()
+
+ set(install-3rd_party_logger_var "install-3rd_party_logger")
+ endif()
+
set(APR_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
set(APR_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE)
set(APR_UTIL_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
set(LOG4CXX_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE)
set(LOG4CXX_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
-endif()
-if(ENABLE_LOG)
# --- libapr-1
add_subdirectory(apr-cmake)
@@ -57,14 +175,117 @@ endif()
# --- D-Bus
if(HMI_DBUS_API)
+ if(NO_REBUILD_3RD_PARTY_DBUS)
+ message(STATUS "Not rebuilding D-Bus.")
+ else()
+ if(FORCE_3RD_PARTY_DBUS)
+ message(STATUS "Force to rebuild D-Bus.")
+
+ #build d-bus
+ add_custom_target(3rd_party_dbus
+ make
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ #install d-bus
+ #install either to default place with sudo or non-default plase without sudo.
+ #to install with sudo to non-default place use manual installation
+ add_custom_target(install-3rd_party_dbus
+ COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ sudo -k \;
+ sudo make install\;
+ else
+ make install\;
+ fi\"
+ DEPENDS 3rd_party_dbus
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+ else()
+ #build d-bus
+ add_custom_target(3rd_party_dbus
+ COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]\; then
+ VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\;
+ VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
+ VAR2=-1\;
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\;
+ fi\;
+ if [ \\$$VAR1 != \\$$VAR2 ]\; then
+ echo " Need to rebuild D-Bus. " \;
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make\;
+ else
+ echo " D-Bus is actual. " \;
+ fi\;
+ else
+ echo " Need to build D-Bus. " \;
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make\;
+ fi\"
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ #install d-bus
+ #install either to default place with sudo or non-default plase without sudo.
+ #to install with sudo to non-default place use manual installation
+ add_custom_target(install-3rd_party_dbus
+ COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]\; then
+ VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\;
+ VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
+ VAR2=-1\;
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\;
+ fi\;
+ if [ \\$$VAR1 != \\$$VAR2 ]\; then
+ USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ sudo -k \;
+ sudo make install\;
+ else
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make install\;
+ fi\;
+ fi\;
+ else
+ USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ sudo -k \;
+ sudo make install\;
+ else
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make install\;
+ fi\;
+ fi\"
+ DEPENDS 3rd_party_dbus
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ set(install-3rd_party_dbus_var "install-3rd_party_dbus")
+ endif()
+ endif()
+
+ # --- D-Bus
set(DBUS_INCLUDE_DIR ${3RD_PARTY_INSTALL_PREFIX}/include)
set(DBUS_INCLUDE_DIR_ARCH ${3RD_PARTY_INSTALL_PREFIX_ARCH}/include)
set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_INCLUDE_DIR_ARCH})
set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIRS} PARENT_SCOPE)
set(DBUS_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
-endif()
-if(HMI_DBUS_API)
add_subdirectory(dbus-cmake)
endif()
+add_custom_target(install-3rd_party
+ DEPENDS ${install-3rd_party_logger_var}
+ DEPENDS ${install-3rd_party_dbus_var}
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+)
+
diff --git a/src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt b/src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt
index a3dd48d1f7..57291f88a4 100644
--- a/src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt
+++ b/src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt
@@ -74,7 +74,7 @@ add_custom_target(liblog4cxx ALL make
cd ${CMAKE_CURRENT_SOURCE_DIR} &&
git log --pretty=\\"format:%H\\" -1 ${LOG4CXX_SOURCE_DIRECTORY} > /tmp/commit_hash 2>/dev/null &&
echo \\"Adding .commit_hash section\\" &&
- ${objcopy} --add-section .commit_hash=/tmp/commit_hash ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so 1>/dev/null 2>&1\;
+ objcopy --add-section .commit_hash=/tmp/commit_hash ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so 1>/dev/null 2>&1\;
fi;
fi\"
DEPENDS ${LOG4CXX_BUILD_DIRECTORY}/Makefile
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index debcfe66c2..e5f85f7a46 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/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,12 +28,55 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-IF (HMIADAPTER STREQUAL "messagebroker")
-set (BROKER_LIBRARIES
- MessageBrokerClient
- MessageBrokerServer
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+find_package(SDLOpenSSL REQUIRED)
+
+if (EXTENDED_MEDIA_MODE)
+ set(default_media_inc
+ ${GSTREAMER_gst_INCLUDE_DIR}
+ ${GSTREAMER_gstconfig_INCLUDE_DIR}
+ )
+else(EXTENDED_MEDIA_MODE)
+ set(default_media_inc)
+endif()
+
+include_directories(
+ ${COMPONENTS_DIR}/protocol_handler/include
+ ${COMPONENTS_DIR}/application_manager/include
+ ${COMPONENTS_DIR}/formatters/include
+ ${COMPONENTS_DIR}/transport_manager/include
+ ${COMPONENTS_DIR}/security_manager/include
+ ${COMPONENTS_DIR}/security_manager/include
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/utils/include
+ ${COMPONENTS_DIR}/connection_handler/include
+ ${COMPONENTS_DIR}/hmi_message_handler/include
+ ${COMPONENTS_DIR}/request_watchdog/include
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${COMPONENTS_DIR}/media_manager/include
+ ${COMPONENTS_DIR}/telemetry_monitor/include
+ ${POLICY_PATH}/include/
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
+ ${COMPONENTS_DIR}/rpc_base/include/
+ ${COMPONENTS_DIR}/resumption/include
+ ${COMPONENTS_DIR}/dbus/include
+ ${CMAKE_BINARY_DIR}/src/components
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${OPENSSL_INCLUDE_DIRECTORY}
+ ${default_media_inc}
+ ${MESSAGE_BROKER_INCLUDE_DIRECTORY}
)
-ENDIF ()
+
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+
+if (HMIADAPTER STREQUAL "messagebroker")
+ set (BROKER_LIBRARIES
+ message_broker_client
+ message_broker_server
+ )
+endif()
cmake_policy(PUSH)
# make link_directories() treat paths relative to the source dir
@@ -42,18 +85,10 @@ cmake_policy(SET CMP0015 NEW)
link_directories(${LIBUSB_LIBS_DIRECTORY})
cmake_policy(POP)
-if (EXTENDED_MEDIA_MODE)
-set(default_media_inc
-${GSTREAMER_gst_INCLUDE_DIR}
-)
-else(EXTENDED_MEDIA_MODE)
-set(default_media_inc
-)
-endif()
-
if (TELEMETRY_MONITOR)
- set(TELEMETRY_MONITOR_LIB
- TelemetryMonitor)
+ set(TELEMETRY_MONITOR_LIB
+ TelemetryMonitor
+ )
endif()
set(LIBRARIES
@@ -72,7 +107,7 @@ set(LIBRARIES
TransportManager
${SecurityManagerLibrary}
HMIMessageHandler
- MessageBroker
+ message_broker
${BROKER_LIBRARIES}
Utils
jsoncpp
@@ -86,12 +121,15 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()
if (BUILD_BT_SUPPORT)
- list(APPEND LIBRARIES bluetooth)
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ list(APPEND LIBRARIES bluetooth)
+ endif()
endif()
+
if (BUILD_USB_SUPPORT)
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- list(APPEND LIBRARIES Libusb-1.0.16)
-endif()
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ list(APPEND LIBRARIES Libusb-1.0.16)
+ endif()
endif()
if(ENABLE_LOG)
@@ -101,51 +139,10 @@ if(ENABLE_LOG)
list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
endif()
-include_directories (
- ./
- ${COMPONENTS_DIR}/protocol_handler/include/
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/application_manager/include
- ${COMPONENTS_DIR}/formatters/include
- ${COMPONENTS_DIR}/transport_manager/include
- ${COMPONENTS_DIR}/security_manager/include
- ${SecurityManagerIncludeDir}
- ${COMPONENTS_DIR}/security_manager/include
- ${COMPONENTS_DIR}/config_profile/include
- ${COMPONENTS_DIR}/utils/include/
- ${COMPONENTS_DIR}/connection_handler/include/
- ${COMPONENTS_DIR}/hmi_message_handler/include
- ${COMPONENTS_DIR}/request_watchdog/include
- ${COMPONENTS_DIR}/smart_objects/include/
- ${COMPONENTS_DIR}/media_manager/include/
- ${COMPONENTS_DIR}/telemetry_monitor/include
- ${COMPONENTS_DIR}/policy/include/
- ${COMPONENTS_DIR}/resumption/include/
- ${MESSAGE_BROKER_INCLUDE_DIRECTORY}
- ${ENCRYPTION_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}
- ${CMAKE_BINARY_DIR}/src/components/
- ${COMPONENTS_DIR}/dbus/include/
- ${CMAKE_SOURCE_DIR}
- ${default_media_inc}
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8
- ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8/dbus/
-)
-
-set (SOURCES
- main.cc
- life_cycle.cc
- signal_handlers.cc
-)
-
-if( NOT CMAKE_BUILD_TYPE )
- set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build. Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
-endif()
-
add_executable(${PROJECT} ${SOURCES})
target_link_libraries(${PROJECT} ${LIBRARIES})
+add_dependencies(${PROJECT} Policy)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/audio.8bit.wav DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
@@ -153,6 +150,9 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.txt DESTINATION ${CMAKE_CURRENT_BINAR
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/hmi_capabilities.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/sdl_preloaded_pt.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/sample_policy_manager.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/start.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/start_external_proprietary.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/init_policy.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif ()
@@ -202,16 +202,12 @@ endif ()
install(TARGETS ${PROJECT} DESTINATION bin)
install(
FILES log4cxx.properties audio.8bit.wav test.txt smartDeviceLink.ini
- hmi_capabilities.json sdl_preloaded_pt.json
+ hmi_capabilities.json sdl_preloaded_pt.json sample_policy_manager.py
${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem
DESTINATION bin
)
-if (${WEB_HMI})
- if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- install( DIRECTORY ${CMAKE_HOME_DIRECTORY}/src/components/HMI/ DESTINATION bin/HMI)
- endif ()
-elseif (${QT_HMI})
+if (${QT_HMI})
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
install(FILES start-qml.sh DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
@@ -226,3 +222,14 @@ if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif ()
+
+if (${EXTENDED_POLICY} STREQUAL "EXTERNAL_PROPRIETARY")
+ install(FILES start_external_proprietary.sh DESTINATION bin
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
+ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE RENAME start.sh)
+else()
+ install(FILES start.sh DESTINATION bin
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
+ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+endif()
+
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 41cf1d3bee..2369543e32 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -343,7 +343,7 @@
},
"TTS":
{
- "capabilities":"TEXT",
+ "capabilities":["TEXT"],
"language":"EN-US",
"languages":
[
diff --git a/src/appMain/life_cycle.cc b/src/appMain/life_cycle.cc
index 1d8e92210e..9b4910585f 100644
--- a/src/appMain/life_cycle.cc
+++ b/src/appMain/life_cycle.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
@@ -34,7 +34,7 @@
#include "utils/signals.h"
#include "utils/make_shared.h"
#include "config_profile/profile.h"
-#include "resumption/last_state.h"
+#include "resumption/last_state_impl.h"
#ifdef ENABLE_SECURITY
#include "security_manager/security_manager_impl.h"
@@ -102,8 +102,8 @@ LifeCycle::LifeCycle(const profile::Profile& profile)
bool LifeCycle::StartComponents() {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK(!last_state_);
- last_state_ = new resumption::LastState(profile_.app_storage_folder(),
- profile_.app_info_storage());
+ last_state_ = new resumption::LastStateImpl(profile_.app_storage_folder(),
+ profile_.app_info_storage());
DCHECK(!transport_manager_);
transport_manager_ = new transport_manager::TransportManagerDefault(profile_);
@@ -128,6 +128,7 @@ bool LifeCycle::StartComponents() {
hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(profile_);
media_manager_ = new media_manager::MediaManagerImpl(*app_manager_, profile_);
+ app_manager_->set_connection_handler(connection_handler_);
if (!app_manager_->Init(*last_state_, media_manager_)) {
LOG4CXX_ERROR(logger_, "Application manager init failed.");
return false;
@@ -177,7 +178,6 @@ bool LifeCycle::StartComponents() {
// It's important to initialise TM after setting up listener chain
// [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
app_manager_->set_protocol_handler(protocol_handler_);
- app_manager_->set_connection_handler(connection_handler_);
app_manager_->set_hmi_message_handler(hmi_handler_);
transport_manager_->Init(*last_state_);
@@ -292,15 +292,6 @@ bool LifeCycle::InitMessageSystem() {
}
#endif // DBUS_HMIADAPTER
-#ifdef MQUEUE_HMIADAPTER
-bool LifeCycle::InitMessageSystem() {
- hmi_message_adapter_ = new hmi_message_handler::MqueueAdapter(hmi_handler_);
- hmi_handler.AddHMIMessageAdapter(hmi_message_adapter_);
- return true;
-}
-
-#endif // MQUEUE_HMIADAPTER
-
namespace {
void sig_handler(int sig) {
switch (sig) {
diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h
index 2d6e0b938e..f1b3800254 100644
--- a/src/appMain/life_cycle.h
+++ b/src/appMain/life_cycle.h
@@ -43,9 +43,6 @@
#if (defined(MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI))
#include "hmi_message_handler/messagebroker_adapter.h"
#endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
-#ifdef MQUEUE_HMIADAPTER
-#include "hmi_message_handler/mqueue_adapter.h"
-#endif // MQUEUE_HMIADAPTER
#include "application_manager/application_manager_impl.h"
#include "connection_handler/connection_handler_impl.h"
#include "protocol_handler/protocol_handler_impl.h"
diff --git a/src/appMain/main.cc b/src/appMain/main.cc
index 9507a52e7b..58ab02b123 100644
--- a/src/appMain/main.cc
+++ b/src/appMain/main.cc
@@ -127,9 +127,9 @@ int32_t main(int32_t argc, char** argv) {
profile::Profile profile_instance;
main_namespace::LifeCycle life_cycle(profile_instance);
if ((argc > 1) && (0 != argv)) {
- profile_instance.config_file_name(argv[1]);
+ profile_instance.set_config_file_name(argv[1]);
} else {
- profile_instance.config_file_name("smartDeviceLink.ini");
+ profile_instance.set_config_file_name("smartDeviceLink.ini");
}
// --------------------------------------------------------------------------
@@ -146,6 +146,15 @@ int32_t main(int32_t argc, char** argv) {
LOG4CXX_INFO(logger_, "Application started!");
LOG4CXX_INFO(logger_, "SDL version: " << profile_instance.sdl_version());
+ // Check if no error values were read from config file
+ if (profile_instance.ErrorOccured()) {
+ const std::string& error = profile_instance.ErrorDescription();
+ LOG4CXX_FATAL(logger_, error);
+ FLUSH_LOGGER();
+ DEINIT_LOGGER();
+ exit(EXIT_FAILURE);
+ }
+
// --------------------------------------------------------------------------
// Components initialization
if (!life_cycle.StartComponents()) {
diff --git a/src/appMain/sample_policy_manager.py b/src/appMain/sample_policy_manager.py
new file mode 100644
index 0000000000..681c7bbb91
--- /dev/null
+++ b/src/appMain/sample_policy_manager.py
@@ -0,0 +1,123 @@
+#!/usr/bin/env python
+import argparse
+import asyncore
+import socket
+import json
+
+import tornado.httpserver
+import tornado.websocket
+import tornado.ioloop
+import tornado.web
+
+parser = argparse.ArgumentParser()
+parser.add_argument("--host", type=str, default="127.0.0.1",
+ help="Host to listen HMI")
+parser.add_argument("--pack_port", type=int, default="8088",
+ help="Port for packing policy table", required=True)
+parser.add_argument("--unpack_port", type=int, default="8089",
+ help="Port for unpacking policy table", required=True)
+parser.add_argument("--buffer_size", type=int, default=8192,
+ help="Size of buffer for input data")
+parser.add_argument("--add_http_header", action="store_true",
+ help="Enter this parameter to add HTTP heaer on packing policy table")
+parser.add_argument("--encryption", action="store_true",
+ help="Encrypt policy table")
+
+
+def http_header(data):
+ header = {}
+ header["HTTPRequest"] = {}
+ header["HTTPRequest"]["headers"] = {
+ "ConnectTimeout": 60,
+ "ContentType": "application/json",
+ "Content-Length": len(data),
+ "DoInput": True,
+ "DoOutput": True,
+ "InstanceFollowRedirects": False,
+ "ReadTimeout": 60,
+ "RequestMethod": "POST",
+ "UseCaches": False,
+ "charset": "utf-8"}
+ header["HTTPRequest"]["body"] = data
+ return json.dumps(header)
+
+
+def crypt(data):
+ return data
+
+
+def decrypt(data):
+ return data
+
+def pack(file_path, encryption, add_http_header):
+
+ file = open(file_path, "r+")
+ data = file.read()
+ file.seek(0)
+ file.truncate()
+
+ if encryption:
+ data = crypt(data)
+ if add_http_header:
+ data = http_header(data)
+
+ file.write(data)
+ file.close()
+ return file_path
+
+
+def unpack(file_path, encryption):
+
+ file = open(file_path, 'r+')
+ read_data = file.read()
+ file.seek(0)
+ file.truncate()
+
+ json_data = json.loads(read_data)
+ policy_data = json.dumps(json_data['data'][0])
+
+ if encryption:
+ policy_data = decrypt(policy_data)
+
+ file.write(policy_data)
+ file.close()
+
+ return file_path
+
+
+class WebSocketHandler(tornado.websocket.WebSocketHandler):
+
+ def initialize(self,encryption, add_http_header, handle_func):
+ self.handle_func = handle_func
+ self.encryption = encryption
+ self.add_http_header = add_http_header
+
+ def open(self):
+ print ("Socket Connected\n")
+
+ def on_message(self, data):
+ self.write_message(self.handle_func(data, self.encryption, self.add_http_header))
+
+ def on_close(self):
+ print ("Connection Closed\n")
+
+ def check_origin(self, origin):
+ return True
+
+
+if __name__ == "__main__":
+
+ args = parser.parse_args()
+
+ pack_application = tornado.web.Application([(r'/', WebSocketHandler, dict(encryption=args.encryption, add_http_header=args.add_http_header,
+ handle_func = lambda data, encryption, add_http_header: pack(data, encryption, add_http_header)))])
+
+ unpack_application = tornado.web.Application([(r'/', WebSocketHandler, dict(encryption=args.encryption, add_http_header=None,
+ handle_func = lambda data, encryption, add_http_header: unpack(data, encryption)))])
+
+ pack_server = tornado.httpserver.HTTPServer(pack_application)
+ unpack_server = tornado.httpserver.HTTPServer(unpack_application)
+
+ pack_server.listen(args.pack_port, args.host)
+ unpack_server.listen(args.unpack_port, args.host)
+ tornado.ioloop.IOLoop.instance().start() \ No newline at end of file
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 15c0739913..10f1303ec7 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -907,6 +907,25 @@
}
}
},
+ "WayPoints": {
+ "rpcs": {
+ "GetWayPoints": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SubscribeWayPoints": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "UnsubscribeWayPoints": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
"BackgroundAPT": {
"rpcs": {
"EndAudioPassThru": {
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index a9baf8c45a..c5cd4dab8e 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -238,3 +238,20 @@ UseDBForResumption = false
AttemptsToOpenResumptionDB = 5
; Timeout between attempts during opening DB in milliseconds
OpenAttemptTimeoutMsResumptionDB = 500
+
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true
+
diff --git a/src/appMain/start.sh b/src/appMain/start.sh
new file mode 100644
index 0000000000..ea6dea9d50
--- /dev/null
+++ b/src/appMain/start.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+LD_LIBRARY_PATH=. ./smartDeviceLinkCore \ No newline at end of file
diff --git a/src/appMain/start_external_proprietary.sh b/src/appMain/start_external_proprietary.sh
new file mode 100644
index 0000000000..15ee2ecae5
--- /dev/null
+++ b/src/appMain/start_external_proprietary.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+pip list | grep -F tornado > /dev/null
+if [ $? -eq 1 ]
+ then
+ echo "Installing tornado python package"
+ sudo pip install tornado
+fi
+echo "Starting Policy Manager"
+python sample_policy_manager.py --pack_port 8088 --unpack_port 8089 --add_http_header --encryption &
+POLICY_MANAGER=$!
+
+trap ctrl_c INT
+
+function ctrl_c() {
+ echo "Stopping SmartDeviceLinkCore"
+ kill -INT $POLICY_MANAGER
+ kill -9 $POLICY_MANAGER
+}
+
+echo "Starting SmartDeviceLinkCore"
+LD_LIBRARY_PATH=. ./smartDeviceLinkCore
diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt
index d31141b36c..0304ce986f 100644
--- a/src/components/CMakeLists.txt
+++ b/src/components/CMakeLists.txt
@@ -28,69 +28,70 @@
# 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)
+# --- 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&nbsp;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 d44cf6c69e..0cfb80ed64 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_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,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)
set (AM_SOURCE_DIR ${COMPONENTS_DIR}/application_manager)
set (AM_TEST_DIR ${AM_SOURCE_DIR}/test)
@@ -41,15 +43,16 @@ include_directories (
${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}/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}
@@ -68,286 +71,322 @@ 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
+)
+
+set (EVENT_ENGINE_SOURCE_DIR
+ ${AM_SOURCE_DIR}/src/event_engine
+)
+
+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 RESUMPTION
- ${AM_SOURCE_DIR}/src/resumption/*
+set(MOBILE_COMMANDS_EXCLUDE_PATHS
+ ${COMMANDS_SOURCE_DIR}/hmi
)
-file (GLOB MOBILE_COMMANDS_SOURCES
- ${AM_SOURCE_DIR}/src/commands/*
- ${AM_SOURCE_DIR}/src/commands/mobile/*
+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
- ${AM_SOURCE_DIR}/src/commands/hmi/request_to_hmi.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/response_from_hmi.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/request_from_hmi.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/response_to_hmi.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/notification_to_hmi.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/notification_from_hmi.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/allow_all_apps_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/allow_all_apps_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/allow_app_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/allow_app_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/update_sdl_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/update_sdl_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/activate_app_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/activate_app_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/get_system_info_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/get_system_info_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_list_of_permissions_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_list_of_permissions_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_user_friendly_message_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_user_friendly_message_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_status_update_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_status_update_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_status_update_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_activate_app_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_activate_app_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/mixing_audio_supported_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/mixing_audio_supported_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/update_app_list_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/update_app_list_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_update_device_list.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/update_device_list_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/update_device_list_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_audio_data_streaming_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_video_data_streaming_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_sdl_consent_needed_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_sdl_persistence_complete_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_exit_all_applications_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_exit_application_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_navi_way_point_change_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_start_device_discovery.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/close_popup_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/close_popup_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_app_activated_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/button_get_capabilities_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/button_get_capabilities_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_is_ready_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_is_ready_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_add_command_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_add_command_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_delete_command_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_delete_command_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_change_registration_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_change_registration_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_supported_languages_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_supported_languages_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_language_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_language_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_capabilities_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_capabilities_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_is_ready_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_is_ready_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_change_registration_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_change_registration_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_language_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_language_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_supported_languages_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_supported_languages_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_stop_speaking_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_stop_speaking_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_speak_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_speak_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_set_global_properties_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_set_global_properties_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_capabilities_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_capabilities_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_perform_interaction_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vr_perform_interaction_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_add_command_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_add_command_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_delete_command_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_delete_command_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_add_submenu_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_add_submenu_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_delete_submenu_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_delete_submenu_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_supported_languages_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_supported_languages_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_language_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_language_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_capabilities_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_capabilities_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_change_registration_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_change_registration_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_show_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_show_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_alert_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_alert_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_slider_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_scrollable_message_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_scrollable_message_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_global_properties_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_global_properties_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_slider_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_is_ready_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_is_ready_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_end_audio_pass_thru_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_end_audio_pass_thru_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_interaction_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_interaction_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_app_icon_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_app_icon_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_media_clock_timer_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_media_clock_timer_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_show_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_show_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_is_ready_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_is_ready_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_read_did_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_read_did_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_dtcs_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_dtcs_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_diagnostic_message_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_diagnostic_message_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_vehicle_type_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_vehicle_type_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_is_ready_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_is_ready_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_alert_maneuver_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_alert_maneuver_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_update_turn_list_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_update_turn_list_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_show_constant_tbt_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_show_constant_tbt_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_send_location_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_send_location_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_subscribe_way_points_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_subscribe_way_points_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_unsubscribe_way_points_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_unsubscribe_way_points_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_ready_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_system_context_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_device_chosen_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_allow_sdl_functionality_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_app_permission_consent_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_app_registered_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_app_permission_changed_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_app_unregistered_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_driver_distraction_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_ignition_cycle_over_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_system_info_changed_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_file_removed_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_tts_started_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_tts_stopped_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vr_started_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vr_stopped_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vr_command_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_command_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_navi_tbt_client_state_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_app_deactivated_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_tts_language_change_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vr_language_change_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_language_change_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_button_event_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_button_press_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_button_subscription_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_find_applications.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_keyboard_input_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_touch_event_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_reset_timeout_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_start_stream_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_start_stream_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_stop_stream_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_stop_stream_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_audio_start_stream_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_audio_start_stream_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_audio_stop_stream_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_audio_stop_stream_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_get_way_points_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/navi_get_way_points_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_system_request_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_put_file_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_resume_audio_source_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_sdl_close_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_display_layout_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_display_layout_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_record_start_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/add_statistics_info_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_system_error_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/basic_communication_system_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/basic_communication_system_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_policy_update.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/sdl_policy_update_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_received_policy_update.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_policy_update.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/get_urls.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/get_urls_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_device_state_changed_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_tts_reset_timeout_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/dial_number_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/dial_number_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_event_changed_notification.cc
+set (HMI_COMMANDS_SOURCES
+ ${COMMANDS_SOURCE_DIR}/hmi/request_to_hmi.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/response_from_hmi.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/request_from_hmi.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/response_to_hmi.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/notification_to_hmi.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/notification_from_hmi.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/allow_all_apps_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/allow_all_apps_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/allow_app_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/allow_app_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/update_sdl_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/update_sdl_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/activate_app_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/activate_app_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/get_system_info_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/get_system_info_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_list_of_permissions_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_list_of_permissions_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_user_friendly_message_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_user_friendly_message_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_status_update_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_status_update_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_status_update_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_activate_app_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_activate_app_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/mixing_audio_supported_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/mixing_audio_supported_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/update_app_list_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/update_app_list_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_update_device_list.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/update_device_list_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/update_device_list_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_audio_data_streaming_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_video_data_streaming_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_sdl_consent_needed_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_sdl_persistence_complete_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_exit_all_applications_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_exit_application_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_navi_way_point_change_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_start_device_discovery.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/close_popup_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/close_popup_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_app_activated_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/button_get_capabilities_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/button_get_capabilities_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_is_ready_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_is_ready_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_add_command_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_add_command_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_delete_command_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_delete_command_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_change_registration_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_change_registration_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_get_supported_languages_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_get_supported_languages_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_get_language_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_get_language_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_get_capabilities_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_get_capabilities_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_is_ready_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_is_ready_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_change_registration_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_change_registration_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_get_language_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_get_language_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_get_supported_languages_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_get_supported_languages_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_stop_speaking_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_stop_speaking_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_speak_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_speak_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_set_global_properties_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_set_global_properties_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_get_capabilities_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/tts_get_capabilities_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_perform_interaction_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vr_perform_interaction_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_add_command_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_add_command_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_command_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_command_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_add_submenu_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_add_submenu_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_submenu_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_submenu_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_get_supported_languages_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_get_supported_languages_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_get_language_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_get_language_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_get_capabilities_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_get_capabilities_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_change_registration_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_change_registration_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_show_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_show_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_alert_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_alert_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_slider_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_scrollable_message_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_scrollable_message_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_global_properties_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_global_properties_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_slider_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_is_ready_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_is_ready_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_audio_pass_thru_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_audio_pass_thru_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_end_audio_pass_thru_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_end_audio_pass_thru_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_interaction_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_interaction_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_app_icon_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_app_icon_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_media_clock_timer_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_media_clock_timer_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_show_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_show_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_is_ready_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_is_ready_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_read_did_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_read_did_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_get_dtcs_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_get_dtcs_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_diagnostic_message_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_diagnostic_message_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_type_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_type_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_is_ready_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_is_ready_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_alert_maneuver_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_alert_maneuver_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_update_turn_list_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_update_turn_list_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_show_constant_tbt_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_show_constant_tbt_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_send_location_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_send_location_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_subscribe_way_points_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_subscribe_way_points_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_unsubscribe_way_points_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_unsubscribe_way_points_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_ready_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_system_context_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_device_chosen_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_allow_sdl_functionality_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_app_permission_consent_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_app_registered_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_app_permission_changed_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_app_unregistered_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_driver_distraction_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_ignition_cycle_over_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_system_info_changed_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_file_removed_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_tts_started_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_tts_stopped_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vr_started_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vr_stopped_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vr_command_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_ui_command_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_navi_tbt_client_state_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_app_deactivated_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_tts_language_change_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vr_language_change_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_ui_language_change_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_button_event_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_button_press_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_button_subscription_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_find_applications.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_ui_keyboard_input_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_ui_touch_event_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_ui_reset_timeout_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_start_stream_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_start_stream_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_stop_stream_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_stop_stream_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_start_stream_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_start_stream_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_stop_stream_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_stop_stream_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_system_request_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_put_file_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_resume_audio_source_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_sdl_close_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_display_layout_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_display_layout_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_record_start_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/add_statistics_info_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_system_error_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/basic_communication_system_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/basic_communication_system_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_policy_update.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/sdl_policy_update_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_received_policy_update.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_policy_update.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/get_urls.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/get_urls_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_device_state_changed_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_tts_reset_timeout_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/dial_number_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/dial_number_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_event_changed_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_icon_request.cc
)
set (HMI_COMMANDS_SOURCES_JSON
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_vehicle_data_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_vehicle_data_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_vehicle_data_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_subscribe_vehicle_data_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_subscribe_vehicle_data_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_unsubscribe_vehicle_data_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/vi_unsubscribe_vehicle_data_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_vehicle_data_notification.cc
)
set (HMI_COMMANDS_SOURCES_DBUS
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_gps_data_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_speed_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_rpm_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_fuel_level_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_fuel_level_state_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_external_temperature_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_vin_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_prndl_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_tire_pressure_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_odometer_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_belt_status_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_body_information_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_device_status_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_driver_braking_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_wiper_status_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_head_lamp_status_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_engine_torque_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_my_key_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_gps_data_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_speed_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_rpm_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_fuel_level_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_fuel_level_state_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_instant_fuel_consumption_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_external_temperature_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_vin_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_prndl_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_tire_pressure_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_odometer_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_belt_status_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_body_information_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_device_status_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_driver_braking_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_wiper_status_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_head_lamp_status_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_engine_torque_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_acc_pedal_position_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_steering_wheel_angle_notification.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/on_vi_my_key_notification.cc
)
if (${HMI_JSON_API})
- set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_JSON})
+ 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}")
+
+set(LIBRARIES
HMI_API
MOBILE_API
v4_protocol_v1_2_no_extra
@@ -357,42 +396,47 @@ SET (LIBRARIES
dl
formatters
dbms
+ Utils
)
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})
-target_link_libraries("ApplicationManager" ${LIBRARIES} AMHMICommandsLibrary
- AMMobileCommandsLibrary
- AMEventEngine
- AMPolicyLibrary)
+add_library("ApplicationManager" ${SOURCES})
+
+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()
+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_launch/app_launch_ctrl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
new file mode 100644
index 0000000000..9fc85db38c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY 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_LAUNCH_APP_LAUNCH_CTRL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
+#include <string>
+#include "utils/shared_ptr.h"
+
+namespace application_manager {
+class Application;
+typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+} // namespace application_manager
+
+namespace app_launch {
+
+/**
+ * @brief The AppLaunchCtrl class manage logic of AppLaunch feature
+ * It launches all known applications on newly connected device
+ */
+class AppLaunchCtrl {
+ public:
+ /**
+ * @brief OnAppRegistered should be called when application registered
+ * Save application parameters to database
+ * @param app application to save
+ */
+ virtual void OnAppRegistered(const application_manager::Application& app) = 0;
+
+ /**
+ * @brief OnDeviceConnected shoudl be called on device connected event
+ * Start launching saaved applications on ios device
+ * @param device_mac
+ */
+ virtual void OnDeviceConnected(const std::string& device_mac) = 0;
+
+ /**
+ * @brief OnMasterReset clear database of saved applications
+ */
+ virtual void OnMasterReset() = 0;
+ virtual ~AppLaunchCtrl() {}
+};
+
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
new file mode 100644
index 0000000000..1f508eebe5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.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_APP_LAUNCH_APP_LAUNCH_CTRL_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_IMPL_H_
+
+#include "application_manager/app_launch/app_launch_ctrl.h"
+#include "application_manager/app_launch/app_launch_data.h"
+#include "application_manager/app_launch/apps_launcher.h"
+#include "application_manager/app_launch/device_apps_launcher.h"
+#include "application_manager/app_launch_settings.h"
+
+namespace connection_handler {
+class ConnectionHandler;
+} // connection_handler
+
+namespace resumption {
+class ResumeCtrl;
+} // resumption
+
+namespace app_launch {
+// TODO(AK) Use unique pointer
+typedef utils::SharedPtr<timer::Timer> TimerPtr;
+class MultipleAppsLauncherFactoryImpl;
+
+class AppLaunchCtrlImpl : public AppLaunchCtrl {
+ public:
+ /**
+ * @brief allows to create AppLaunchCtrlImpl object
+ */
+ AppLaunchCtrlImpl(AppLaunchData& data,
+ application_manager::ApplicationManager& app_mngr,
+ const AppLaunchSettings& settings);
+
+ /**
+ * @brief allows to destroy AppLaunchCtrlImpl object
+ */
+ ~AppLaunchCtrlImpl() {}
+
+ void OnAppRegistered(const application_manager::Application& app) OVERRIDE;
+ void OnDeviceConnected(const std::string& device_mac) OVERRIDE;
+ void OnMasterReset() OVERRIDE;
+
+ private:
+ const AppLaunchSettings& settings_;
+ AppLaunchData& app_launch_data_;
+ resumption::ResumeCtrl& resume_ctrl_;
+
+ AppsLauncher apps_launcher_;
+ DeviceAppsLauncher device_apps_launcher_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppLaunchCtrlImpl);
+};
+
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
new file mode 100644
index 0000000000..0d52384018
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY 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_LAUNCH_APP_LAUNCH_DATA_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_H_
+
+#include <stdint.h>
+#include <vector>
+#include <string>
+#include "utils/shared_ptr.h"
+
+namespace app_launch {
+
+/**
+ * @brief struct holds AppLaunch data
+ */
+struct ApplicationData {
+ ApplicationData(const std::string& mobile_app_id,
+ const std::string& bundle_id,
+ const std::string& device_id)
+ : mobile_app_id_(mobile_app_id)
+ , bundle_id_(bundle_id)
+ , device_mac_(device_id) {}
+
+ std::string mobile_app_id_;
+ std::string bundle_id_;
+ std::string device_mac_;
+ bool operator==(const ApplicationData& app_data) const {
+ return mobile_app_id_ == app_data.mobile_app_id_ &&
+ bundle_id_ == app_data.bundle_id_ && device_mac_ == device_mac_;
+ }
+};
+typedef utils::SharedPtr<ApplicationData> ApplicationDataPtr;
+
+/**
+ * @brief class contains interfaces to AppLaunchDataDB and AppLaunchDataJson
+ */
+class AppLaunchData {
+ public:
+ /**
+ * @brief allows correct delete heir object
+ */
+ virtual ~AppLaunchData() {}
+
+ /**
+ * @brief insert new data to DB
+ * @param app_data - data to inserting
+ * @return true in success cases and false othrewise
+ */
+ virtual bool AddApplicationData(const ApplicationData& app_data) = 0;
+
+ /**
+ * @brief select from DB all records with this dev_mac
+ * @param app_data - data to inserting
+ * @param dev_apps -
+ * @return vector of pointers on results of select
+ */
+ virtual std::vector<ApplicationDataPtr> GetApplicationDataByDevice(
+ const std::string& dev_mac) = 0;
+ /**
+ * @brief delete App_launch table in DB, after calling this
+ * one, it should again call init
+ * @return true in success cases and false othrewise
+ */
+ virtual bool Clear() = 0;
+
+ /**
+ * @brief Persist saves resumption data on file system
+ */
+ virtual bool Persist() = 0;
+};
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
new file mode 100644
index 0000000000..92d6bbd9ef
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY 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_LAUNCH_APP_LAUNCH_DATA_DB_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_DB_H_
+#include <memory>
+#include "application_manager/app_launch/app_launch_data_impl.h"
+#include "application_manager/app_launch_settings.h"
+#include "utils/macro.h"
+#ifdef __QNX__
+#include "utils/qdb_wrapper/sql_database.h"
+#include "utils/qdb_wrapper/sql_query.h"
+#else // linux
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_query.h"
+#endif
+
+namespace app_launch {
+
+const std::string kDatabaseName = "resumption";
+
+/**
+ * @brief Show should database be saved in a disk file or in memory
+ */
+enum DbStorage { In_Memory_Storage = 0, In_File_Storage };
+
+/**
+ * @brief class contains logic for representation application
+ * launch_app data in data base
+ */
+class AppLaunchDataDB : public AppLaunchDataImpl {
+ public:
+ /**
+ * @brief Constructor of AppLaunchDataDB
+ * @param settings - setting of AppLaunch
+ */
+ AppLaunchDataDB(const AppLaunchSettings& settings,
+ DbStorage db_storage = In_File_Storage);
+
+ /**
+ * @brief allows to destroy AppLaunchDataDB object
+ */
+ ~AppLaunchDataDB();
+
+ /**
+ * @brief Creates or opens DB and initialize it
+ * @return false if DB doesn't initialize
+ * otherwise returns true
+ */
+ bool Init();
+
+ /**
+ * @brief delete App_launch table in DB, after calling this
+ * one, it should again call init
+ * @return true in success cases and false othrewise
+ */
+ bool Clear() OVERRIDE;
+
+ /**
+ * @brief Write database to file system
+ */
+ bool Persist() OVERRIDE;
+
+ /**
+ * @return current count of records
+ * AppLaunch in DB
+ */
+ uint32_t GetCurentNumberOfAppData() const;
+
+ /**
+ * @param app_data - searching fields in object
+ * @return true in case application data already existed
+ * and false othrewise
+ */
+ bool IsAppDataAlreadyExisted(const ApplicationData& app_data) const OVERRIDE;
+
+ /**
+ * @brief returns pointer to data base
+ */
+ utils::dbms::SQLDatabase* db() const;
+
+ enum ApplicationDataDBIndexes {
+ result_query = 0,
+ device_mac_index = 0,
+ application_id_index,
+ bundle_id_index,
+ timestamp_index
+ };
+
+ private:
+ /**
+ * @brief update time stamp
+ * @param app_data - data to update
+ * @return true in success cases and false othrewise
+ */
+ bool RefreshAppSessionTime(const ApplicationData& app_data) OVERRIDE;
+
+ /**
+ * @brief insert new data to DB
+ * @param app_data - data to inserting
+ * @return true in success cases and false othrewise
+ */
+ bool AddNewAppData(const ApplicationData& app_data) OVERRIDE;
+
+ /**
+ * @brief select from DB all records with this dev_mac
+ * @param app_data - data to inserting
+ * @return vector of ponter on founded records
+ */
+ std::vector<ApplicationDataPtr> GetAppDataByDevMac(
+ const std::string& dev_mac) const OVERRIDE;
+ /**
+ * @brief delete record with oldest timestamp
+ * @return true in success cases and false othrewise
+ */
+ bool DeleteOldestAppData() OVERRIDE;
+
+ /**
+ * @brief write DB to file
+ * @return true in success cases and false othrewise
+ */
+ bool WriteDb();
+
+ /**
+ * @brief returns pointer to data base
+ */
+ std::auto_ptr<utils::dbms::SQLDatabase> db_;
+
+ /**
+ * @brief indicate initializing status of DB
+ */
+ bool init_successeful_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppLaunchDataDB);
+};
+
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_DB_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
new file mode 100644
index 0000000000..111ff25ab2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_IMPL_H_
+
+#include "application_manager/app_launch/app_launch_data.h"
+#include "application_manager/app_launch_settings.h"
+
+namespace app_launch {
+
+class AppLaunchDataImpl : public AppLaunchData {
+ public:
+ /**
+ * @brief Constructor of AppLaunchDataImpl
+ * @param settings - setting of AppLaunch
+ */
+ AppLaunchDataImpl(const AppLaunchSettings& settings);
+
+ /**
+ * @brief allows to destroy AppLaunchDataImpl object
+ */
+ virtual ~AppLaunchDataImpl();
+
+ /**
+ * @brief insert new data to DB
+ * @param app_data - data to inserting
+ * @return true in success cases and false othrewise
+ */
+ virtual bool AddApplicationData(const ApplicationData& app_data);
+
+ /**
+ * @brief select from DB all records with this dev_mac
+ * @param app_data - data to inserting
+ * @return return vector of pointers on founded records
+ */
+ std::vector<ApplicationDataPtr> GetApplicationDataByDevice(
+ const std::string& dev_mac) OVERRIDE;
+
+ /**
+ * @brief Persist saves resumption data on file system
+ */
+ virtual bool Persist() = 0;
+
+ /**
+ * @return max count of iOS device that can be connected
+ */
+ virtual uint32_t get_max_number_iOS_devs() const {
+ return kMaxNumberOfiOSdevice;
+ }
+
+ /**
+ * @brief all AppLaunch settings
+ */
+ const AppLaunchSettings& settings_;
+
+ private:
+ /**
+ * @param app_data - searching filled in object
+ * @return true in case application data already existed
+ * and false othrewise
+ */
+ virtual bool IsAppDataAlreadyExisted(
+ const ApplicationData& app_data) const = 0;
+
+ /**
+ * @brief update time stamp
+ * @param app_data - data to update
+ * @return true in success cases and false othrewise
+ */
+ virtual bool RefreshAppSessionTime(const ApplicationData& app_data) = 0;
+
+ /**
+ * @brief insert new data to DB
+ * @param app_data - data to inserting
+ * @return true in success cases and false othrewise
+ */
+ virtual bool AddNewAppData(const ApplicationData& app_data) = 0;
+
+ /**
+ * @brief select from DB all records with this dev_mac
+ * @param app_data - data to inserting
+ * @return vector of ponter on founded records
+ */
+ virtual std::vector<ApplicationDataPtr> GetAppDataByDevMac(
+ const std::string& dev_mac) const = 0;
+
+ /**
+ * @brief delete record with oldest timestamp
+ * @return true in success cases and false othrewise
+ */
+ virtual bool DeleteOldestAppData() = 0;
+
+ /**
+ * @return current count of records
+ * AppLaunch in DB
+ */
+ virtual uint32_t GetCurentNumberOfAppData() const = 0;
+
+ /**
+ * @brief max count of iOS device that can be connected
+ */
+ const uint32_t kMaxNumberOfiOSdevice;
+};
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
new file mode 100644
index 0000000000..61117e552b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_JSON_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_JSON_H_
+
+#include "application_manager/app_launch/app_launch_data_impl.h"
+#include "smart_objects/smart_object.h"
+#include "resumption/last_state.h"
+#include "utils/lock.h"
+#include "utils/macro.h"
+
+namespace app_launch {
+
+enum { NotFound = -1 };
+/**
+ * @brief class contains logic for representation application launch_app data in
+ * json file
+ */
+class AppLaunchDataJson : public AppLaunchDataImpl {
+ public:
+ /**
+ * @brief Constructor of AppLaunchDataJson object
+ */
+ AppLaunchDataJson(const AppLaunchSettings& settings,
+ resumption::LastState& last_state);
+ /**
+ * @brief allows to destroy AppLaunchDataJson object
+ */
+ ~AppLaunchDataJson();
+
+ /**
+ * @brief Write Json to file system
+ */
+ bool Persist() OVERRIDE;
+
+ /**
+ * @brief delete App_launch table in DB, after calling this
+ * one, it should again call init
+ * @return true in success cases and false othrewise
+ */
+ virtual bool Clear();
+
+ /**
+ * @return current count of records
+ * AppLaunch in DB
+ */
+ uint32_t GetCurentNumberOfAppData() const;
+
+ /**
+ * @param app_data - searching filled in object
+ * @return true in case application data already existed
+ * and false othrewise
+ */
+ virtual bool IsAppDataAlreadyExisted(const ApplicationData& app_data) const;
+
+ /**
+ * @param app_data - searching filled in object
+ * @param founded_index - referenceto index of founded record
+ * in case it wasn't found it'll be -1
+ * @return pointer to json list object
+ */
+ Json::Value& GetApplicationListAndIndex(const ApplicationData& app_data,
+ int32_t& founded_index) const;
+
+ private:
+ /**
+ * @brief update time stamp
+ * @param app_data - data to update
+ * @return true in success cases and false othrewise
+ */
+ virtual bool RefreshAppSessionTime(const ApplicationData& app_data);
+
+ /**
+ * @brief insert new data to DB
+ * @param app_data - data to inserting
+ * @return true in success cases and false othrewise
+ */
+ virtual bool AddNewAppData(const ApplicationData& app_data);
+
+ /**
+ * @brief select from DB all records with this dev_mac
+ * @param app_data - data to inserting
+ * @return vector of pointer on founded records
+ */
+ std::vector<ApplicationDataPtr> GetAppDataByDevMac(
+ const std::string& dev_mac) const OVERRIDE;
+
+ /**
+ * @return pointer to LastState functionality
+ */
+ resumption::LastState& last_state() const {
+ return last_state_;
+ }
+
+ /**
+ * @brief delete record with oldest timestamp
+ * @return true in success cases and false othrewise
+ */
+ bool DeleteOldestAppData();
+
+ /**
+ * @return pointer to AppLaunch data block in Json file
+ */
+ Json::Value& GetSavedApplicationDataList() const;
+
+ /**
+ * @return pointer to AppLaunch records block in Json file
+ */
+ Json::Value& GetApplicationData() const;
+
+ /**
+ * @brief lock to protected common data
+ */
+ mutable sync_primitives::Lock app_launch_json_lock_;
+
+ /**
+ * @brief ponter to Last State object
+ */
+ resumption::LastState& last_state_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppLaunchDataJson);
+};
+
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_JSON_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_sql_queries.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_sql_queries.h
new file mode 100644
index 0000000000..4539b49002
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_sql_queries.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY 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_LAUNCH_APP_LAUNCH_SQL_QUERIES_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_SQL_QUERIES_H_
+
+#include <string>
+
+namespace app_launch {
+
+extern const std::string kCreateSchema;
+extern const std::string kDropSchema;
+extern const std::string kFindApplicationData;
+extern const std::string kDeleteOldestAppData;
+extern const std::string kGetNumberOfApplicationData;
+extern const std::string kGetApplicationDataByDevID;
+extern const std::string kAddApplicationData;
+extern const std::string kRefreshApplicationDataSessionTime;
+
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_SQL_QUERIES_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
new file mode 100644
index 0000000000..751e04bada
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
@@ -0,0 +1,86 @@
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APPS_LAUNCHER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APPS_LAUNCHER_H_
+#include "application_manager/app_launch/app_launch_data.h"
+#include "connection_handler/connection_handler.h"
+#include "utils/timer.h"
+
+namespace app_launch {
+class AppLaunchCtrlImpl;
+/**
+ * @brief The AppLauncher struct will manage Launching app and relaunching app
+ * in case application wasn't Registered.
+ * When application registered instance of this structure should be deleted to
+ * stop relaunch timer
+ */
+class AppsLauncher {
+ public:
+ AppsLauncher(connection_handler::ConnectionHandler& connection_handler,
+ const uint16_t max_number_of_ios_device,
+ const uint16_t app_launch_max_retry_attempt,
+ const uint16_t app_launch_retry_wait_time);
+
+ /**
+ * @brief StartLaunching start launching process of applicaiton
+ * @param app_data applicaiton to launch
+ */
+ void StartLaunching(ApplicationDataPtr app_data);
+
+ /**
+ * @brief OnLaunched callback for application registration
+ * @param app_data registered application
+ */
+ void OnLaunched(ApplicationDataPtr app_data);
+
+ /**
+ * @brief OnRetryAttemptsExhausted callback for retry attempt exhausting
+ * @param app_data applicaiton that was exhausted launch attempts
+ */
+ void OnRetryAttemptsExhausted(ApplicationDataPtr app_data);
+
+ struct Launcher {
+ public:
+ Launcher(AppsLauncher& parent,
+ connection_handler::ConnectionHandler& connection_handler,
+ const uint16_t app_launch_max_retry_attempt,
+ const uint16_t app_launch_retry_wait_time);
+
+ /**
+ * @brief PosponedLaunch launch application after cpecial timeout
+ * Will manage launch retrying in case of application wasn't registered
+ * @param app_data applicaiton to launch
+ */
+ void PosponedLaunch(const ApplicationDataPtr& app_data);
+
+ /**
+ * @brief Stops launching timers and remove information about launching
+ * application
+ */
+ void Clear();
+
+ /**
+ * @brief LaunchNow send Launch to device request now
+ */
+ void LaunchNow();
+ ApplicationDataPtr app_data_;
+ size_t retry_index_;
+ timer::Timer retry_timer_;
+ const uint16_t app_launch_max_retry_attempt_;
+ const uint16_t app_launch_retry_wait_time_;
+ connection_handler::ConnectionHandler& connection_handler_;
+ AppsLauncher& parent_;
+ };
+ typedef utils::SharedPtr<Launcher> LauncherPtr;
+ typedef std::vector<LauncherPtr> AppLaunchers;
+
+ private:
+ sync_primitives::Lock launchers_lock_;
+ AppLaunchers free_launchers_;
+ AppLaunchers works_launchers_;
+ friend class Launcher;
+ void StopLaunching(ApplicationDataPtr app_data);
+ DISALLOW_COPY_AND_ASSIGN(AppsLauncher);
+};
+
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APPS_LAUNCHER_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
new file mode 100644
index 0000000000..f1f29471e6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
@@ -0,0 +1,46 @@
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_DEVICE_APPS_LAUNCHER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_DEVICE_APPS_LAUNCHER_H_
+#include <stdint.h>
+#include <vector>
+#include <string>
+#include <memory>
+#include "application_manager/app_launch/app_launch_data.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/app_launch_settings.h"
+
+namespace app_launch {
+class AppLaunchCtrlImpl;
+class DeviceAppsLauncherImpl;
+class AppsLauncher;
+class AppLaunchSettings;
+/**
+ * @brief The MultipleAppsLauncher struct
+ * should manage launching applications and gaps between launching application
+ * on one device
+ * When all apps launched it will notify AppLaunchCtrlImpl that all apps
+ * launched
+ */
+class DeviceAppsLauncher {
+ public:
+ DeviceAppsLauncher(application_manager::ApplicationManager& app_mngr,
+ app_launch::AppsLauncher& apps_launcher,
+ const AppLaunchSettings& settings);
+
+ bool LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch);
+ bool StopLaunchingAppsOnDevice(const std::string& device_mac);
+
+ const AppLaunchSettings& settings() const;
+
+ private:
+ application_manager::ApplicationManager& app_mngr_;
+ const AppLaunchSettings& settings_;
+ std::auto_ptr<DeviceAppsLauncherImpl> impl_;
+ friend class DeviceAppsLauncherImpl;
+ DISALLOW_COPY_AND_ASSIGN(DeviceAppsLauncher);
+};
+
+} // namespace app_launch
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_DEVICE_APPS_LAUNCHER_H_
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index 2c6a27c5f4..c523f61329 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,20 +45,11 @@
#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"
namespace application_manager {
namespace mobile_api = mobile_apis;
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
namespace custom_str = utils::custom_string;
typedef int32_t ErrorCode;
@@ -112,6 +103,8 @@ class InitialApplicationData {
virtual const smart_objects::SmartObject* app_types() const = 0;
virtual const smart_objects::SmartObject* vr_synonyms() const = 0;
virtual const std::string& mac_address() const = 0;
+ virtual const std::string& bundle_id() const = 0;
+ virtual void set_bundle_id(const std::string& bundle_id) = 0;
virtual std::string policy_app_id() const = 0;
virtual const smart_objects::SmartObject* tts_name() const = 0;
virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0;
@@ -219,9 +212,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;
@@ -581,8 +581,8 @@ class Application : public virtual InitialApplicationData,
* @param source Limits source, e.g. policy table, config file etc.
* @return true, if - excedeed, otherwise - false
*/
- virtual bool IsCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
- TLimitSource source) = 0;
+ virtual bool AreCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
+ TLimitSource source) = 0;
/**
* Returns object for recording statistics
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 75496b2761..ae63a2f8ae 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -139,6 +139,8 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
const std::string& app_icon_path() const;
connection_handler::DeviceHandle device() const;
const std::string& mac_address() const OVERRIDE;
+ const std::string& bundle_id() const OVERRIDE;
+ void set_bundle_id(const std::string& bundle_id) OVERRIDE;
void set_tts_properties_in_none(bool active);
bool tts_properties_in_none();
void set_tts_properties_in_full(bool active);
@@ -154,6 +156,7 @@ 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;
@@ -199,8 +202,8 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
UsageStatistics& usage_report();
- bool IsCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
- TLimitSource source);
+ bool AreCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
+ TLimitSource source);
virtual void SubscribeToSoftButtons(int32_t cmd_id,
const SoftButtonID& softbuttons_id);
virtual bool IsSubscribedToSoftButton(const uint32_t softbutton_id);
@@ -357,7 +360,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
std::string app_icon_path_;
connection_handler::DeviceHandle device_;
const std::string mac_address_;
-
+ std::string bundle_id_;
AppFilesMap app_files_;
std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
VehicleInfoSubscriptions subscribed_vehicle_info_;
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 97c38cd134..0000000000
--- a/src/components/application_manager/include/application_manager/application_manager.h
+++ /dev/null
@@ -1,580 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_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"
-
-namespace resumption {
-class LastState;
-}
-
-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
- */
- virtual void TerminateRequest(uint32_t connection_key, uint32_t corr_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 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 dda192f8b0..0e6f598a9c 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_IMPL_H_
#include <stdint.h>
#include <vector>
@@ -39,6 +39,7 @@
#include <set>
#include <deque>
#include <algorithm>
+#include <memory>
#include "application_manager/hmi_command_factory.h"
#include "application_manager/application_manager.h"
@@ -49,8 +50,10 @@
#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 "protocol_handler/protocol_observer.h"
#include "protocol_handler/protocol_handler.h"
@@ -88,13 +91,7 @@
#include "utils/lock.h"
#include "utils/data_accessor.h"
#include "utils/timer.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+#include "smart_objects/smart_object.h"
namespace threads {
class Thread;
@@ -190,7 +187,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
@@ -317,8 +313,8 @@ class ApplicationManagerImpl
void OnApplicationRegistered(ApplicationSharedPtr app) OVERRIDE;
- HMICapabilities& hmi_capabilities();
- const HMICapabilities& hmi_capabilities() const;
+ HMICapabilities& hmi_capabilities() OVERRIDE;
+ const HMICapabilities& hmi_capabilities() const OVERRIDE;
/**
* @brief ProcessQueryApp executes logic related to QUERY_APP system request.
@@ -512,6 +508,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
@@ -708,8 +765,11 @@ class ApplicationManagerImpl
* @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
*/
- void TerminateRequest(uint32_t connection_key, uint32_t corr_id) OVERRIDE;
+ void TerminateRequest(const uint32_t connection_key,
+ const uint32_t corr_id,
+ const int32_t function_id) OVERRIDE;
// Overriden ProtocolObserver method
void OnMessageReceived(
const ::protocol_handler::RawMessagePtr message) OVERRIDE;
@@ -741,12 +801,12 @@ class ApplicationManagerImpl
// Overriden SecurityManagerListener method
bool OnHandshakeDone(
uint32_t connection_key,
- security_manager::SSLContext::HandshakeResult result) OVERRIDE FINAL;
+ security_manager::SSLContext::HandshakeResult result) OVERRIDE;
- void OnCertificateUpdateRequired() OVERRIDE FINAL;
+ void OnCertificateUpdateRequired() OVERRIDE;
security_manager::SSLContext::HandshakeContext GetHandshakeContext(
- uint32_t key) const OVERRIDE FINAL;
+ uint32_t key) const OVERRIDE;
#endif // ENABLE_SECURITY
/**
@@ -839,7 +899,11 @@ class ApplicationManagerImpl
* @return Resume Controller
*/
resumption::ResumeCtrl& resume_controller() OVERRIDE {
- return resume_ctrl_;
+ return *resume_ctrl_.get();
+ }
+
+ HmiInterfaces& hmi_interfaces() OVERRIDE {
+ return hmi_interfaces_;
}
/**
@@ -940,24 +1004,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
*/
@@ -984,13 +1038,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;
@@ -1102,6 +1149,8 @@ class ApplicationManagerImpl
const ApplicationManagerSettings& get_settings() const OVERRIDE;
virtual event_engine::EventDispatcher& event_dispatcher() OVERRIDE;
+ app_launch::AppLaunchCtrl& app_launch_ctrl() OVERRIDE;
+
private:
/**
* @brief PullLanguagesInfo allows to pull information about languages.
@@ -1386,7 +1435,7 @@ 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_;
@@ -1409,7 +1458,7 @@ class ApplicationManagerImpl
// Thread that pumps messages audio pass thru to mobile.
impl::AudioPassThruQueue audio_pass_thru_messages_;
- HMICapabilities hmi_capabilities_;
+ std::auto_ptr<HMICapabilities> hmi_capabilities_;
// The reason of HU shutdown
mobile_api::AppInterfaceUnregisteredReason::eType unregister_reason_;
@@ -1418,7 +1467,9 @@ class ApplicationManagerImpl
* about persistent application data on disk, and save session ID for resuming
* application in case INGITION_OFF or MASTER_RESSET
*/
- resumption::ResumeCtrl resume_ctrl_;
+ std::auto_ptr<resumption::ResumeCtrl> resume_ctrl_;
+
+ HmiInterfacesImpl hmi_interfaces_;
NaviServiceStatusMap navi_service_status_;
std::deque<uint32_t> navi_app_to_stop_;
@@ -1430,6 +1481,8 @@ class ApplicationManagerImpl
sync_primitives::Lock timer_pool_lock_;
sync_primitives::Lock stopping_application_mng_lock_;
StateControllerImpl state_ctrl_;
+ std::auto_ptr<app_launch::AppLaunchData> app_launch_dto_;
+ std::auto_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
#ifdef TELEMETRY_MONITOR
AMTelemetryObserver* metric_observer_;
@@ -1441,6 +1494,8 @@ class ApplicationManagerImpl
bool is_low_voltage_;
+ uint32_t apps_size_;
+
volatile bool is_stopping_;
DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
@@ -1460,4 +1515,4 @@ inline bool ApplicationManagerImpl::all_apps_allowed() const {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_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..66456dfdb1 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 {
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 c5f45e2095..f585410e97 100644
--- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
@@ -1,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
@@ -37,18 +37,76 @@
#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) {}
+ 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;
+};
+
namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+/**
+ * @brief MergeInfos merge 2 infos in one string
+ * @param first - info string that should be first in result info
+ * @param second - info string that should be second in result info
+ * @return if first is empty return second
+ * if second is empty return first
+ * if both are empty return empty string
+ * if both are not empty return empty first +", " + second
+ */
+std::string MergeInfos(const std::string& first, const std::string& second);
+
+/**
+ * @brief MergeInfos merge 2 infos into one string with info
+ * @param first_info -contains result_code from HMI response and
+ * interface that returns response
+ * @param first_str - info string that should be first in result info
+ * @param second_info -contains result_code from HMI response and
+ * interface that returns response
+ * @param second_str - info string that should be second in result info
+ * @return if first_info is not available and second_str not empty return second
+ * if second_info is not available and first_str not empty return first
+ * other cases return result MergeInfos for 2 params
+ */
+std::string MergeInfos(const ResponseInfo& first_info,
+ const std::string& first_str,
+ const ResponseInfo& second_info,
+ const std::string& second_str);
+
+/**
+ * @brief MergeInfos merge 3 infos in one string
+ * @param first - info string that should be first in result info
+ * @param second - info string that should be second in result info
+ * @param third - info string that should be second in result info
+ * @return resulting string contain merge all incoming parameters
+ */
+std::string MergeInfos(const std::string& first,
+ const std::string& second,
+ const std::string& third);
+
class CommandRequestImpl : public CommandImpl,
public event_engine::EventObserver {
public:
@@ -153,6 +211,54 @@ class CommandRequestImpl : public CommandImpl,
*/
bool HasDisallowedParams() const;
+ /**
+ * @brief Checks result code from HMI for single RPC
+ * and returns parameter for sending to mobile app.
+ * @param result_code contains result code from HMI response
+ * @param interface contains interface for which HMI sent response
+ * @return true if result code complies successful result cods
+ * otherwise returns false.
+ */
+ bool PrepareResultForMobileResponse(
+ hmi_apis::Common_Result::eType result_code,
+ HmiInterfaces::InterfaceID interface) const;
+
+ /**
+ * @brief Checks result code from HMI for splitted RPC
+ * and returns parameter for sending to mobile app.
+ * @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 result code complies successful result code
+ * otherwise returns false
+ */
+ bool PrepareResultForMobileResponse(ResponseInfo& out_first,
+ ResponseInfo& out_second) const;
+
+ /**
+ * @brief If message from HMI contains returns this info
+ * or process result code from HMI and checks state of interface
+ * and create info.
+ * @param interface contains interface for which HMI sent response
+ * @param result_code contains result code from HMI
+ * @param response_from_hmi contains response from HMI
+ * @param out_info contain info for sending to application
+ */
+ void GetInfo(const smart_objects::SmartObject& response_from_hmi,
+ std::string& out_info);
+
+ /**
+ * @brief Prepare result code for sending to mobile application
+ * @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 resulting code for sending to mobile application.
+ */
+ mobile_apis::Result::eType PrepareResultCodeForResponse(
+ const ResponseInfo& first, const ResponseInfo& second);
+
protected:
/**
* @brief Returns policy parameters permissions
@@ -182,6 +288,10 @@ class CommandRequestImpl : public CommandImpl,
*/
void AddDisallowedParametersToInfo(
smart_objects::SmartObject& response) const;
+
+ bool ProcessHMIInterfacesAvailability(
+ const uint32_t hmi_correlation_id,
+ const hmi_apis::FunctionID::eType& function_id);
};
} // 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_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 9f1adaeee0..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
@@ -42,7 +42,8 @@ namespace commands {
/**
* @brief NaviIsReadyRequest command class
**/
-class NaviIsReadyRequest : public RequestToHMI {
+class NaviIsReadyRequest : public RequestToHMI,
+ public event_engine::EventObserver {
public:
/**
* @brief NaviIsReadyRequest class constructor
@@ -60,7 +61,12 @@ class NaviIsReadyRequest : public RequestToHMI {
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const event_engine::Event& event) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
@@ -70,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/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_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..a752e00801 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"
@@ -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/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/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
index e512279e79..b30044fd26 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
@@ -40,6 +40,27 @@ namespace application_manager {
namespace commands {
+/**
+ * @brief Check if HMI's interface is available.
+ * @param application_manager contains application manager component
+ * @param interface contains name of HMI's interface
+ * @return true if interface is available otherwise return fasle.
+ */
+bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
+ HmiInterfaces::InterfaceID interface);
+
+/**
+ * @brief Change interface state
+ * @param application_manager contains ApplicationManager instance
+ * @param response_from_hmi contains response from HMI
+ * @param interface contanins InterfaceID whose state is changed.
+ * @return true if field available exist and contains true in response params
+ * otherwise return false.
+ */
+bool ChangeInterfaceState(ApplicationManager& application_manager,
+ const smart_objects::SmartObject& response_from_hmi,
+ HmiInterfaces::InterfaceID interface);
+
class RequestToHMI : public CommandImpl {
public:
RequestToHMI(const MessageSharedPtr& message,
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/tts_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
index 81bd8eb27b..340a00d294 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
@@ -42,7 +42,8 @@ namespace commands {
/**
* @brief TTSIsReadyRequest command class
**/
-class TTSIsReadyRequest : public RequestToHMI {
+class TTSIsReadyRequest : public RequestToHMI,
+ public event_engine::EventObserver {
public:
/**
* @brief TTSIsReadyRequest class constructor
@@ -60,7 +61,22 @@ class TTSIsReadyRequest : public RequestToHMI {
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
private:
DISALLOW_COPY_AND_ASSIGN(TTSIsReadyRequest);
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
index a505df6de4..49942d81a7 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
@@ -42,7 +42,8 @@ namespace commands {
/**
* @brief UIIsReadyRequest command class
**/
-class UIIsReadyRequest : public RequestToHMI {
+class UIIsReadyRequest : public RequestToHMI,
+ public event_engine::EventObserver {
public:
/**
* @brief UIIsReadyRequest class constructor
@@ -60,7 +61,22 @@ class UIIsReadyRequest : public RequestToHMI {
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ virtual void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
private:
DISALLOW_COPY_AND_ASSIGN(UIIsReadyRequest);
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_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_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
index 9049db4d24..07ab9df605 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
@@ -42,7 +42,8 @@ namespace commands {
/**
* @brief VIIsReadyRequest command class
**/
-class VIIsReadyRequest : public RequestToHMI {
+class VIIsReadyRequest : public RequestToHMI,
+ public event_engine::EventObserver {
public:
/**
* @brief VIIsReadyRequest class constructor
@@ -60,7 +61,22 @@ class VIIsReadyRequest : public RequestToHMI {
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
private:
DISALLOW_COPY_AND_ASSIGN(VIIsReadyRequest);
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_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
index 9fc4ccd2f3..55a2101e1a 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
@@ -34,6 +34,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
#include "application_manager/commands/hmi/request_to_hmi.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -42,7 +43,8 @@ namespace commands {
/**
* @brief VRIsReadyRequest command class
**/
-class VRIsReadyRequest : public RequestToHMI {
+class VRIsReadyRequest : public RequestToHMI,
+ public event_engine::EventObserver {
public:
/**
* @brief VRIsReadyRequest class constructor
@@ -60,7 +62,22 @@ class VRIsReadyRequest : public RequestToHMI {
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
private:
DISALLOW_COPY_AND_ASSIGN(VRIsReadyRequest);
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 22a0c7e85f..854ea7f21f 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,10 @@
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"
#include "application_manager/commands/command_request_impl.h"
@@ -72,6 +74,12 @@ class AddCommandRequest : public CommandRequestImpl {
*/
void on_event(const event_engine::Event& event);
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ */
+ virtual void onTimeOut();
+
private:
/*
* @brief Check if command name doesn't exist in application
@@ -103,12 +111,6 @@ class AddCommandRequest : public CommandRequestImpl {
bool CheckCommandParentId(ApplicationConstSharedPtr app);
/**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- */
- virtual void onTimeOut();
-
- /**
* @brief Removes command from list when HMI sends negative response or
* HMI does not answer on addCommand request.
*/
@@ -133,12 +135,21 @@ class AddCommandRequest : public CommandRequestImpl {
inline bool BothSend() const;
+ /**
+ * @brief GenerateMobileResponseInfo generated info for mobile response
+ * depends from UI and VR responses
+ * @return info for mobile response
+ */
+ const std::string GenerateMobileResponseInfo();
bool send_ui_;
bool send_vr_;
bool is_ui_received_;
bool is_vr_received_;
+ std::string ui_info_;
+ std::string vr_info_;
+
hmi_apis::Common_Result::eType ui_result_;
hmi_apis::Common_Result::eType vr_result_;
};
@@ -146,4 +157,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..10e2628035 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"
@@ -85,4 +85,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 472ff45551..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"
@@ -75,6 +75,15 @@ class AlertManeuverRequest : public CommandRequestImpl {
private:
/**
+ * @brief Prepare parameters for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param return_info contains resulting info for sending to mobile
+ * application
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& return_info);
+ /**
* @brief Checks alert maneuver params(ttsChunks, ...).
* When type is String there is a check on the contents \t\n \\t \\n
* @return if alert maneuver contains \t\n \\t \\n return TRUE,
@@ -82,8 +91,8 @@ class AlertManeuverRequest : public CommandRequestImpl {
*/
bool IsWhiteSpaceExist();
- mobile_apis::Result::eType tts_speak_result_code_;
- mobile_apis::Result::eType navi_alert_maneuver_result_code_;
+ hmi_apis::Common_Result::eType tts_speak_result_code_;
+ hmi_apis::Common_Result::eType navi_alert_maneuver_result_code_;
std::string info_navi_;
std::string info_tts_;
Pending pending_requests_;
@@ -94,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 bc99665d82..77f1813e46 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,10 @@
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>
#include "application_manager/commands/command_request_impl.h"
#include "interfaces/MOBILE_API.h"
@@ -126,14 +128,25 @@ class AlertRequest : public CommandRequestImpl {
*/
bool CheckStringsOfAlertRequest();
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for mobile app.
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
bool awaiting_ui_alert_response_;
bool awaiting_tts_speak_response_;
bool awaiting_tts_stop_speaking_response_;
bool is_alert_succeeded_;
bool is_ui_alert_sent_;
- mobile_apis::Result::eType alert_result_;
+ hmi_apis::Common_Result::eType alert_result_;
smart_objects::SmartObject alert_response_params_;
- mobile_apis::Result::eType tts_speak_result_;
+ hmi_apis::Common_Result::eType tts_speak_result_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
DISALLOW_COPY_AND_ASSIGN(AlertRequest);
};
@@ -141,4 +154,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 c81ed0b5d3..f783af12b3 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
@@ -106,15 +106,6 @@ class ChangeRegistrationRequest : public CommandRequestImpl {
*/
bool IsPendingResponseExist();
- /*
- * @brief Checks result codes
- *
- * @return true if all of result codes is success
- */
- bool AllHmiResponsesSuccess(const hmi_apis::Common_Result::eType ui,
- const hmi_apis::Common_Result::eType vr,
- const hmi_apis::Common_Result::eType tts);
-
/**
* @brief Checks change_registration params(ttsName, appname,
* ngnMediaScreenAppName, vrSynonyms) on invalid characters.
@@ -141,11 +132,20 @@ class ChangeRegistrationRequest : public CommandRequestImpl {
bool IsNicknameAllowed(const custom_str::CustomString& app_name) const;
/**
- * @brief Predicate for using with CheckCoincidence method to compare with VR
- * synonym SO
- *
- * @return TRUE if there is coincidence of VR, otherwise FALSE
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param response_info contains info for sending to mobile application
+ * @return result for sending to mobile application.
*/
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& ResponseInfo);
+
+ /**
+ * @brief Predicate for using with CheckCoincidence method to compare with VR
+ * synonym SO
+ *
+ * @return TRUE if there is coincidence of VR, otherwise FALSE
+ */
struct CoincidencePredicateVR {
CoincidencePredicateVR(const custom_str::CustomString& newItem)
: newItem_(newItem){};
@@ -163,6 +163,9 @@ class ChangeRegistrationRequest : public CommandRequestImpl {
hmi_apis::Common_Result::eType ui_result_;
hmi_apis::Common_Result::eType vr_result_;
hmi_apis::Common_Result::eType tts_result_;
+ std::string ui_response_info_;
+ std::string vr_response_info_;
+ std::string tts_response_info_;
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 d66db3d548..987f773d44 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
@@ -71,7 +71,6 @@ class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
**/
virtual void Run();
- private:
/**
* @brief Interface method that is called whenever new event received
*
@@ -88,6 +87,8 @@ class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
* @brief DeleteChoices allows to walk through the sent commands collection
* in order to sent appropriate DeleteCommand request.
*/
+
+ private:
void DeleteChoices();
/**
@@ -231,6 +232,30 @@ class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
*/
bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set);
+ /**
+ * @brief ProcessHmiError process received error from HMI.
+ * This function id not thread safe. It should be protected with
+ * vr_commands_lock_
+ * @param vr_result ERROR type
+ */
+ void ProcessHmiError(const hmi_apis::Common_Result::eType vr_result);
+
+ /**
+ * @brief ProcessSuccesfulHMIResponse process succesful response from HMI\
+ * This function id not thread safe. It should be protected with
+ * vr_commands_lock_
+ * @param corr_id correlation id of received response
+ * @return true if resuest with corr_itd was sent on HMI, false otherwise
+ */
+ bool ProcessSuccesfulHMIResponse(const uint32_t corr_id);
+
+ /**
+ * @brief CountReceivedVRResponses counts received HMI responses. Updated
+ * request timeout if not all responses received
+ * Send response to mobile if all responses received.
+ */
+ void CountReceivedVRResponses();
+
DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
};
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 6a19014c96..3483aea1d6 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,10 @@
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"
#include "utils/macro.h"
@@ -81,6 +83,15 @@ class DeleteCommandRequest : public CommandRequestImpl {
*/
bool IsPendingResponseExist();
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for mobile app.
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
bool is_ui_send_;
bool is_vr_send_;
@@ -89,9 +100,11 @@ class DeleteCommandRequest : public CommandRequestImpl {
hmi_apis::Common_Result::eType ui_result_;
hmi_apis::Common_Result::eType vr_result_;
+ std::string ui_info_;
+ std::string vr_info_;
};
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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..12c80138b4 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"
@@ -81,4 +81,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 7c48de5d8e..b9c27ba294 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"
@@ -65,6 +65,13 @@ class DeleteSubMenuRequest : public CommandRequestImpl {
**/
virtual void Run();
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
private:
/*
* @brief Deletes VR commands from SDL for corresponding submenu ID
@@ -84,17 +91,10 @@ class DeleteSubMenuRequest : public CommandRequestImpl {
*/
void DeleteSubMenuUICommands(ApplicationSharedPtr const app);
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
};
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
+#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_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 b69cb969e1..99f86ea1d5 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"
@@ -85,23 +85,31 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
void on_event(const event_engine::Event& event);
private:
- /*
+ /**
+ * @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.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+ /**
* @brief Sends TTS Speak request
*/
void SendSpeakRequest();
- /*
+ /**
* @brief Sends UI PerformAudioPassThru request
*/
void SendPerformAudioPassThruRequest();
- /*
+ /**
* @brief Sends UI RecordStart notification after TTS Speak response received.
* Indicates that capturing mic data should be started
*/
void SendRecordStartNotification();
- /*
+ /**
* @brief Starts microphone recording
*/
void StartMicrophoneRecording();
@@ -115,21 +123,25 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
bool IsWhiteSpaceExist();
/**
- * @brief Waiting for TTS.Speak response, after default timeout send
- * GENERIC_ERROR response
- * @return if receive TTS.Speak return TRUE, FALSE otherwise
- */
- bool WaitTTSSpeak();
-
- /**
* @brief If is_active_tts_speak_ TRUE - set up to FALSE and send request
* TTS_StopSpeaking to HMI
*/
void FinishTTSSpeak();
- // flag display state of speak during perform audio pass thru
- bool is_active_tts_speak_;
- mobile_apis::Result::eType result_tts_speak_;
+ /*
+ * @brief Tells if there are sent requests without responses
+ */
+ 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_;
+
+ hmi_apis::Common_Result::eType result_tts_speak_;
+ hmi_apis::Common_Result::eType result_ui_;
+ std::string ui_info_;
+ std::string tts_info_;
DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruRequest);
};
@@ -137,4 +149,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 f64b2ab334..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,10 @@
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"
#include "application_manager/application.h"
@@ -79,7 +81,6 @@ class PerformInteractionRequest : public CommandRequestImpl {
*/
virtual void on_event(const event_engine::Event& event);
- private:
/*
* @brief Function is called by RequestController when request execution time
* has exceed it's limit
@@ -87,25 +88,23 @@ class PerformInteractionRequest : public CommandRequestImpl {
*/
virtual void onTimeOut();
- /*
+ private:
+ /**
* @brief Function will be called when VR_OnCommand event
* comes
- *
* @param message which should send to mobile side
- *
+ * @return true if send response to mobile application otherwise
+ * return false.
*/
- void ProcessVRResponse(const smart_objects::SmartObject& message,
+ bool ProcessVRResponse(const smart_objects::SmartObject& message,
smart_objects::SmartObject& msg_params);
- /*
+ /**
* @brief Sends PerformInteraction response to mobile side
- *
* @param message which should send to mobile side
- *
*/
- void ProcessPerformInteractionResponse(
- const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params);
+ void ProcessUIResponse(const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params);
/*
* @brief Sends UI PerformInteraction request to HMI
@@ -218,26 +217,20 @@ class PerformInteractionRequest : public CommandRequestImpl {
const bool HasHMIResponsesToWait() const;
/**
- * @brief Check VR response result code, in case GENERIC_ERROR, REJECTED,
- * send resultCode FALSE, in case WARNINGS send resultCode TRUE
- */
- void CheckResponseResultCode();
-
- /**
* @brief Check UI & VR result codes, send response to mobile
* @param msg_param Message params to send
*/
void SendBothModeResponse(const smart_objects::SmartObject& msg_param);
mobile_apis::InteractionMode::eType interaction_mode_;
- bool ui_response_recived_;
- bool vr_response_recived_;
- bool ui_result_;
- bool vr_result_;
+ bool ui_response_received_;
+ bool vr_response_received_;
bool app_pi_was_active_before_;
static uint32_t pi_requests_count_;
- mobile_apis::Result::eType vr_resultCode_;
- mobile_apis::Result::eType ui_resultCode_;
+ hmi_apis::Common_Result::eType vr_result_code_;
+ hmi_apis::Common_Result::eType ui_result_code_;
+ std::string ui_info_;
+ std::string vr_info_;
DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
};
@@ -245,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 dc7f9fb755..cc3d5b685c 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
@@ -90,6 +90,23 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
const uint32_t connection_key, ApplicationSharedPtr app);
/**
+ * @brief SendChangeRegistration send ChangeRegistration on HMI
+ * @param function_id interface specific ChangeRegistration
+ * @param language language of registration
+ * @param app_id application to change registration
+ */
+ void SendChangeRegistration(const hmi_apis::FunctionID::eType function_id,
+ const int32_t language,
+ const uint32_t app_id);
+
+ /**
+ * @brief SendChangeRegistrationOnHMI send required SendChangeRegistration
+ * HMI
+ * @param app application to change registration
+ */
+ void SendChangeRegistrationOnHMI(ApplicationConstSharedPtr app);
+
+ /**
* @brief Sends OnAppRegistered notification to HMI
*
*@param application_impl application with changed HMI status
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..49e5fe34ff 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
@@ -108,6 +108,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
@@ -124,6 +134,8 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl {
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/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 aa26a70393..0300245af8 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
@@ -32,7 +32,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
-
+#include <string>
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
#include "application_manager/application.h"
@@ -125,6 +125,15 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl {
*/
bool IsWhiteSpaceExist();
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for sending to mobile applicaion
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
bool is_ui_send_;
bool is_tts_send_;
@@ -133,6 +142,8 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl {
hmi_apis::Common_Result::eType ui_result_;
hmi_apis::Common_Result::eType tts_result_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
};
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 6b2c2bb616..fb21823b3a 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
@@ -113,6 +113,26 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl {
const smart_objects::SmartObject& msg_params) const;
/**
+ * @brief Checks if current application and other applications
+ * were subscribed to VI, prepare data that need to send to mobile app
+ * or HMI.
+ * @param app contains application
+ * @param out_info contains resulting info for sending to mobile app
+ * @param out_result_code contains result code for sending to mobile app
+ * @param out_response_params contains parameters that SDL sends to
+ * mobile application
+ * @param out_request_params contains parameters that SDL sends to
+ * HMI
+ * @param result contains result that SDL sends to mobile app.
+ */
+ void CheckVISubscribtions(ApplicationSharedPtr app,
+ std::string& out_info,
+ mobile_apis::Result::eType& out_result_code,
+ smart_objects::SmartObject& out_response_params,
+ smart_objects::SmartObject& out_request_params,
+ bool& out_result);
+
+ /**
* @brief VI parameters which had been already subscribed by another apps
* befor particular app subscribed for these parameters
*/
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/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/hmi_capabilities.h b/src/components/application_manager/include/application_manager/hmi_capabilities.h
deleted file mode 100644
index f94c8125c8..0000000000
--- a/src/components/application_manager/include/application_manager/hmi_capabilities.h
+++ /dev/null
@@ -1,605 +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_HMI_CAPABILITIES_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
-
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "json/json.h"
-#include "utils/macro.h"
-#include "application_manager/hmi_language_handler.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-namespace resumption {
-class LastState;
-}
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-namespace application_manager {
-class ApplicationManager;
-
-class HMICapabilities {
- public:
- /*
- * @ Class constructor
- *
- * @param app_mngr Application manager pointer
- */
- explicit HMICapabilities(ApplicationManager& app_mngr);
-
- /*
- * @brief Class destructor
- *
- */
- virtual ~HMICapabilities();
-
- /**
- * @brief Checks if all HMI capabilities received
- *
- * @return TRUE if all information received, otherwise FALSE
- */
- bool is_hmi_capabilities_initialized() const;
-
- /*
- * @brief Checks is image type(Static/Dynamic) requested by
- * Mobile Device is supported on current HMI.
- * @param image_type recieved type of image from Enum.
- * @return Bool true if supported
- */
- bool VerifyImageType(int32_t image_type) const;
-
- /**
- * @brief Checks if all HMI capabilities received
- *
- * @return TRUE if all information received, otherwise FALSE
- */
- inline bool is_vr_cooperating() const;
- void set_is_vr_cooperating(bool value);
-
- inline bool is_tts_cooperating() const;
- void set_is_tts_cooperating(bool value);
-
- inline bool is_ui_cooperating() const;
- void set_is_ui_cooperating(bool value);
-
- inline bool is_navi_cooperating() const;
- void set_is_navi_cooperating(bool value);
-
- inline bool is_ivi_cooperating() const;
- void set_is_ivi_cooperating(bool value);
-
- /*
- * @brief Retrieves if mixing audio is supported by HMI
- * (ie recording TTS command and playing audio)
- *
- * @return Current state of the mixing audio flag
- */
- inline bool attenuated_supported() const;
-
- /*
- * @brief Sets state for mixing audio
- *
- * @param state New state to be set
- */
- void set_attenuated_supported(bool state);
-
- /*
- * @brief Retrieves currently active UI language
- *
- * @return Currently active UI language
- */
- const hmi_apis::Common_Language::eType active_ui_language() const;
-
- /*
- * @brief Sets currently active UI language
- *
- * @param language Currently active UI language
- */
- void set_active_ui_language(const hmi_apis::Common_Language::eType& language);
-
- /*
- * @brief Retrieves UI supported languages
- *
- * @return Currently supported UI languages
- */
- inline const smart_objects::SmartObject* ui_supported_languages() const;
-
- /*
- * @brief Sets supported UI languages
- *
- * @param supported_languages Supported UI languages
- */
- void set_ui_supported_languages(
- const smart_objects::SmartObject& supported_languages);
-
- /*
- * @brief Retrieves currently active VR language
- *
- * @return Currently active VR language
- */
- const hmi_apis::Common_Language::eType active_vr_language() const;
-
- /*
- * @brief Sets currently active VR language
- *
- * @param language Currently active VR language
- */
- void set_active_vr_language(const hmi_apis::Common_Language::eType& language);
-
- /*
- * @brief Retrieves VR supported languages
- *
- * @return Currently supported VR languages
- */
- inline const smart_objects::SmartObject* vr_supported_languages() const;
-
- /*
- * @brief Sets supported VR languages
- *
- * @param supported_languages Supported VR languages
- */
- void set_vr_supported_languages(
- const smart_objects::SmartObject& supported_languages);
-
- /*
- * @brief Retrieves currently active TTS language
- *
- * @return Currently active TTS language
- */
- const hmi_apis::Common_Language::eType active_tts_language() const;
-
- /*
- * @brief Sets currently active TTS language
- *
- * @param language Currently active TTS language
- */
- void set_active_tts_language(
- const hmi_apis::Common_Language::eType& language);
-
- /*
- * @brief Retrieves TTS supported languages
- *
- * @return Currently supported TTS languages
- */
- inline const smart_objects::SmartObject* tts_supported_languages() const;
-
- /*
- * @brief Sets supported TTS languages
- *
- * @param supported_languages Supported TTS languages
- */
- void set_tts_supported_languages(
- const smart_objects::SmartObject& supported_languages);
-
- /*
- * @brief Retrieves information about the display capabilities
- *
- * @return Currently supported display capabilities
- */
- inline const smart_objects::SmartObject* display_capabilities() const;
-
- /*
- * @brief Sets supported display capabilities
- *
- * @param display_capabilities supported display capabilities
- */
- void set_display_capabilities(
- const smart_objects::SmartObject& display_capabilities);
-
- /*
- * @brief Retrieves information about the HMI zone capabilities
- *
- * @return Currently supported HMI zone capabilities
- */
- inline const smart_objects::SmartObject* hmi_zone_capabilities() const;
-
- /*
- * @brief Sets supported HMI zone capabilities
- *
- * @param hmi_zone_capabilities supported HMI zone capabilities
- */
- void set_hmi_zone_capabilities(
- const smart_objects::SmartObject& hmi_zone_capabilities);
-
- /*
- * @brief Retrieves information about the SoftButton's capabilities
- *
- * @return Currently supported SoftButton's capabilities
- */
- inline const smart_objects::SmartObject* soft_button_capabilities() const;
-
- /*
- * @brief Sets supported SoftButton's capabilities
- *
- * @param soft_button_capabilities supported SoftButton's capabilities
- */
- void set_soft_button_capabilities(
- const smart_objects::SmartObject& soft_button_capabilities);
-
- /*
- * @brief Retrieves information about the Button's capabilities
- *
- * @return Currently supported Button's capabilities
- */
- inline const smart_objects::SmartObject* button_capabilities() const;
-
- /*
- * @brief Sets supported Button's capabilities
- *
- * @param soft_button_capabilities supported Button's capabilities
- */
- void set_button_capabilities(
- const smart_objects::SmartObject& button_capabilities);
-
- /*
- * @brief Sets supported speech capabilities
- *
- * @param speech_capabilities supported speech capabilities
- */
- void set_speech_capabilities(
- const smart_objects::SmartObject& speech_capabilities);
-
- /*
- * @brief Retrieves information about the speech capabilities
- *
- * @return Currently supported speech capabilities
- */
- inline const smart_objects::SmartObject* speech_capabilities() const;
-
- /*
- * @brief Sets supported VR capabilities
- *
- * @param vr_capabilities supported VR capabilities
- */
- void set_vr_capabilities(const smart_objects::SmartObject& vr_capabilities);
-
- /*
- * @brief Retrieves information about the VR capabilities
- *
- * @return Currently supported VR capabilities
- */
- inline const smart_objects::SmartObject* vr_capabilities() const;
-
- /*
- * @brief Sets supported audio_pass_thru capabilities
- *
- * @param vr_capabilities supported audio_pass_thru capabilities
- */
- void set_audio_pass_thru_capabilities(
- const smart_objects::SmartObject& audio_pass_thru_capabilities);
-
- /*
- * @brief Sets supported pcm_stream capabilities
- *
- * @param supported pcm stream capabilities
- */
- void set_pcm_stream_capabilities(
- const smart_objects::SmartObject& pcm_stream_capabilities);
-
- /*
- * @brief Retrieves information about the audio_pass_thru capabilities
- *
- * @return Currently supported audio_pass_thru capabilities
- */
- inline const smart_objects::SmartObject* audio_pass_thru_capabilities() const;
-
- /*
- * @brief Retrieves information about the pcm_stream capabilities
- *
- * @return Currently supported pcm_streaming capabilities
- */
- inline const smart_objects::SmartObject* pcm_stream_capabilities() const;
-
- /*
- * @brief Retrieves information about the preset bank capabilities
- *
- * @return Currently supported preset bank capabilities
- */
- inline const smart_objects::SmartObject* preset_bank_capabilities() const;
-
- /*
- * @brief Sets supported preset bank capabilities
- *
- * @param soft_button_capabilities supported preset bank capabilities
- */
- void set_preset_bank_capabilities(
- const smart_objects::SmartObject& preset_bank_capabilities);
-
- /*
- * @brief Sets vehicle information(make, model, modelYear)
- *
- * @param vehicle_type Cuurent vehicle information
- */
- void set_vehicle_type(const smart_objects::SmartObject& vehicle_type);
-
- /*
- * @brief Retrieves vehicle information(make, model, modelYear)
- *
- * @param vehicle_type Cuurent vehicle information
- */
- inline const smart_objects::SmartObject* vehicle_type() const;
-
- /*
- * @brief Retrieves information about the prerecorded speech
- *
- * @return Currently supported prerecorded speech
- */
- inline const smart_objects::SmartObject* prerecorded_speech() const;
-
- /*
- * @brief Sets supported prerecorded speech
- *
- * @param prerecorded_speech supported prerecorded speech
- */
- void set_prerecorded_speech(
- const smart_objects::SmartObject& prerecorded_speech);
-
- /*
- * @brief Interface used to store information if navigation
- * supported by the system
- *
- * @param supported Indicates if navigation supported by the system
- */
- void set_navigation_supported(bool supported);
-
- /*
- * @brief Retrieves information if navi supported by the system
- *
- * @return TRUE if it supported, otherwise FALSE
- */
- inline bool navigation_supported() const;
-
- /*
- * @brief Interface used to store information if phone call
- * supported by the system
- *
- * @param supported Indicates if navigation supported by the sustem
- */
- void set_phone_call_supported(bool supported);
-
- /*
- * @brief Retrieves information if phone call supported by the system
- *
- * @return TRUE if it supported, otherwise FALSE
- */
- inline bool phone_call_supported() const;
-
- /*
- * @brief Interface used to store information about software version of the
- *target
- *
- * @param ccpu_version Received system/hmi software version
- */
- void set_ccpu_version(const std::string& ccpu_version);
-
- /*
- * @brief Returns software version of the target
- *
- * @return TRUE if it supported, otherwise FALSE
- */
- inline const std::string& ccpu_version() const;
-
- void Init(resumption::LastState* last_state);
-
- /**
- * @brief return component which follows for correctness of
- * languages
- * @return HMI language handler
- */
- HMILanguageHandler& get_hmi_language_handler() {
- return hmi_language_handler_;
- }
-
- protected:
- /*
- * @brief Loads capabilities from local file in case SDL was launched
- * without HMI
- *
- * @return TRUE if capabilities loaded successfully, otherwise FALSE.
- */
- bool load_capabilities_from_file();
-
- /*
- * @brief function checks if json member exists
- *
- * @param json_member from file hmi_capabilities.json
- * @param name_of_member name which we should check
- * hmi_capabilities.json
- *
- * @returns TRUE if member exists and returns FALSE if
- * member does not exist.
- */
- bool check_existing_json_member(const Json::Value& json_member,
- const char* name_of_member);
-
- /*
- * @brief function converts json object "languages" to smart object
- *
- * @param json_languages from file hmi_capabilities.json
- * @param languages - the converted object
- *
- */
- void convert_json_languages_to_obj(Json::Value& json_languages,
- smart_objects::SmartObject& languages);
-
- private:
- bool is_vr_cooperating_;
- bool is_tts_cooperating_;
- bool is_ui_cooperating_;
- bool is_navi_cooperating_;
- bool is_ivi_cooperating_;
-
- // to check if IsReady response for corresponding interface received
- bool is_vr_ready_response_recieved_;
- bool is_tts_ready_response_recieved_;
- bool is_ui_ready_response_recieved_;
- bool is_navi_ready_response_recieved_;
- bool is_ivi_ready_response_recieved_;
-
- bool attenuated_supported_;
- hmi_apis::Common_Language::eType ui_language_;
- hmi_apis::Common_Language::eType vr_language_;
- hmi_apis::Common_Language::eType tts_language_;
- smart_objects::SmartObject* vehicle_type_;
- smart_objects::SmartObject* ui_supported_languages_;
- smart_objects::SmartObject* tts_supported_languages_;
- smart_objects::SmartObject* vr_supported_languages_;
- smart_objects::SmartObject* display_capabilities_;
- smart_objects::SmartObject* hmi_zone_capabilities_;
- smart_objects::SmartObject* soft_buttons_capabilities_;
- smart_objects::SmartObject* button_capabilities_;
- smart_objects::SmartObject* preset_bank_capabilities_;
- smart_objects::SmartObject* vr_capabilities_;
- smart_objects::SmartObject* speech_capabilities_;
- smart_objects::SmartObject* audio_pass_thru_capabilities_;
- smart_objects::SmartObject* pcm_stream_capabilities_;
- smart_objects::SmartObject* prerecorded_speech_;
- std::string ccpu_version_;
- bool is_navigation_supported_;
- bool is_phone_call_supported_;
-
- ApplicationManager& app_mngr_;
- HMILanguageHandler hmi_language_handler_;
-
- DISALLOW_COPY_AND_ASSIGN(HMICapabilities);
-};
-
-bool HMICapabilities::is_ui_cooperating() const {
- return is_ui_cooperating_;
-}
-
-bool HMICapabilities::is_vr_cooperating() const {
- return is_vr_cooperating_;
-}
-
-bool HMICapabilities::is_tts_cooperating() const {
- return is_tts_cooperating_;
-}
-
-bool HMICapabilities::is_navi_cooperating() const {
- return is_navi_cooperating_;
-}
-
-bool HMICapabilities::is_ivi_cooperating() const {
- return is_ivi_cooperating_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::ui_supported_languages()
- const {
- return ui_supported_languages_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::vr_supported_languages()
- const {
- return vr_supported_languages_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::tts_supported_languages()
- const {
- return tts_supported_languages_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::display_capabilities()
- const {
- return display_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::hmi_zone_capabilities()
- const {
- return hmi_zone_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::soft_button_capabilities()
- const {
- return soft_buttons_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::button_capabilities() const {
- return button_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::speech_capabilities() const {
- return speech_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::vr_capabilities() const {
- return vr_capabilities_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::audio_pass_thru_capabilities() const {
- return audio_pass_thru_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::pcm_stream_capabilities()
- const {
- return pcm_stream_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::preset_bank_capabilities()
- const {
- return preset_bank_capabilities_;
-}
-
-bool HMICapabilities::attenuated_supported() const {
- return attenuated_supported_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::vehicle_type() const {
- return vehicle_type_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::prerecorded_speech() const {
- return prerecorded_speech_;
-}
-
-const std::string& HMICapabilities::ccpu_version() const {
- return ccpu_version_;
-}
-
-bool HMICapabilities::navigation_supported() const {
- return is_navigation_supported_;
-}
-
-bool HMICapabilities::phone_call_supported() const {
- return is_phone_call_supported_;
-}
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
new file mode 100644
index 0000000000..7a85c49027
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
@@ -0,0 +1,496 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_
+
+#include "application_manager/hmi_capabilities.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "json/json.h"
+#include "utils/macro.h"
+#include "application_manager/hmi_language_handler.h"
+#include "smart_objects/smart_object.h"
+
+namespace resumption {
+class LastState;
+} // namespace resumption
+
+namespace application_manager {
+class ApplicationManager;
+
+class HMICapabilitiesImpl : public HMICapabilities {
+ public:
+ /*
+ * @ Class constructor
+ *
+ * @param app_mngr Application manager pointer
+ */
+ explicit HMICapabilitiesImpl(ApplicationManager& app_mngr);
+
+ /*
+ * @brief Class destructor
+ *
+ */
+ virtual ~HMICapabilitiesImpl();
+
+ /*
+ * @brief Checks is image type(Static/Dynamic) requested by
+ * Mobile Device is supported on current HMI.
+ * @param image_type recieved type of image from Enum.
+ * @return Bool true if supported
+ */
+ bool VerifyImageType(const int32_t image_type) const OVERRIDE;
+
+ /**
+ * @brief Checks if all HMI capabilities received
+ *
+ * @return TRUE if all information received, otherwise FALSE
+ */
+ bool is_vr_cooperating() const OVERRIDE;
+ void set_is_vr_cooperating(const bool value) OVERRIDE;
+
+ bool is_tts_cooperating() const OVERRIDE;
+ void set_is_tts_cooperating(const bool value) OVERRIDE;
+
+ bool is_ui_cooperating() const OVERRIDE;
+ void set_is_ui_cooperating(const bool value) OVERRIDE;
+
+ bool is_navi_cooperating() const OVERRIDE;
+ void set_is_navi_cooperating(const bool value) OVERRIDE;
+
+ bool is_ivi_cooperating() const OVERRIDE;
+ void set_is_ivi_cooperating(const bool value) OVERRIDE;
+
+ /*
+ * @brief Interface used to store information about software version of the
+ *target
+ *
+ * @param ccpu_version Received system/hmi software version
+ */
+ void set_ccpu_version(const std::string& ccpu_version) OVERRIDE;
+
+ /*
+ * @brief Returns software version of the target
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ const std::string& ccpu_version() const OVERRIDE;
+
+ /*
+ * @brief Retrieves if mixing audio is supported by HMI
+ * (ie recording TTS command and playing audio)
+ *
+ * @return Current state of the mixing audio flag
+ */
+ bool attenuated_supported() const OVERRIDE;
+
+ /*
+ * @brief Sets state for mixing audio
+ *
+ * @param state New state to be set
+ */
+ void set_attenuated_supported(const bool state) OVERRIDE;
+
+ /*
+ * @brief Retrieves currently active UI language
+ *
+ * @return Currently active UI language
+ */
+ const hmi_apis::Common_Language::eType active_ui_language() const OVERRIDE;
+
+ /*
+ * @brief Sets currently active UI language
+ *
+ * @param language Currently active UI language
+ */
+ void set_active_ui_language(
+ const hmi_apis::Common_Language::eType language) OVERRIDE;
+
+ /*
+ * @brief Retrieves UI supported languages
+ *
+ * @return Currently supported UI languages
+ */
+ const smart_objects::SmartObject* ui_supported_languages() const OVERRIDE;
+
+ /*
+ * @brief Sets supported UI languages
+ *
+ * @param supported_languages Supported UI languages
+ */
+ void set_ui_supported_languages(
+ const smart_objects::SmartObject& supported_languages) OVERRIDE;
+
+ /*
+ * @brief Retrieves currently active VR language
+ *
+ * @return Currently active VR language
+ */
+ const hmi_apis::Common_Language::eType active_vr_language() const OVERRIDE;
+
+ /*
+ * @brief Sets currently active VR language
+ *
+ * @param language Currently active VR language
+ */
+ void set_active_vr_language(
+ const hmi_apis::Common_Language::eType language) OVERRIDE;
+
+ /*
+ * @brief Retrieves VR supported languages
+ *
+ * @return Currently supported VR languages
+ */
+ const smart_objects::SmartObject* vr_supported_languages() const OVERRIDE;
+
+ /*
+ * @brief Sets supported VR languages
+ *
+ * @param supported_languages Supported VR languages
+ */
+ void set_vr_supported_languages(
+ const smart_objects::SmartObject& supported_languages) OVERRIDE;
+
+ /*
+ * @brief Retrieves currently active TTS language
+ *
+ * @return Currently active TTS language
+ */
+ const hmi_apis::Common_Language::eType active_tts_language() const OVERRIDE;
+
+ /*
+ * @brief Sets currently active TTS language
+ *
+ * @param language Currently active TTS language
+ */
+ void set_active_tts_language(
+ const hmi_apis::Common_Language::eType language) OVERRIDE;
+
+ /*
+ * @brief Retrieves TTS supported languages
+ *
+ * @return Currently supported TTS languages
+ */
+ const smart_objects::SmartObject* tts_supported_languages() const OVERRIDE;
+
+ /*
+ * @brief Sets supported TTS languages
+ *
+ * @param supported_languages Supported TTS languages
+ */
+ void set_tts_supported_languages(
+ const smart_objects::SmartObject& supported_languages) OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the display capabilities
+ *
+ * @return Currently supported display capabilities
+ */
+ const smart_objects::SmartObject* display_capabilities() const OVERRIDE;
+
+ /*
+ * @brief Sets supported display capabilities
+ *
+ * @param display_capabilities supported display capabilities
+ */
+ void set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the HMI zone capabilities
+ *
+ * @return Currently supported HMI zone capabilities
+ */
+ const smart_objects::SmartObject* hmi_zone_capabilities() const OVERRIDE;
+
+ /*
+ * @brief Sets supported HMI zone capabilities
+ *
+ * @param hmi_zone_capabilities supported HMI zone capabilities
+ */
+ void set_hmi_zone_capabilities(
+ const smart_objects::SmartObject& hmi_zone_capabilities) OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the SoftButton's capabilities
+ *
+ * @return Currently supported SoftButton's capabilities
+ */
+ const smart_objects::SmartObject* soft_button_capabilities() const OVERRIDE;
+
+ /*
+ * @brief Sets supported SoftButton's capabilities
+ *
+ * @param soft_button_capabilities supported SoftButton's capabilities
+ */
+ void set_soft_button_capabilities(
+ const smart_objects::SmartObject& soft_button_capabilities) OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the Button's capabilities
+ *
+ * @return Currently supported Button's capabilities
+ */
+ const smart_objects::SmartObject* button_capabilities() const OVERRIDE;
+
+ /*
+ * @brief Sets supported Button's capabilities
+ *
+ * @param soft_button_capabilities supported Button's capabilities
+ */
+ void set_button_capabilities(
+ const smart_objects::SmartObject& button_capabilities) OVERRIDE;
+
+ /*
+ * @brief Sets supported speech capabilities
+ *
+ * @param speech_capabilities supported speech capabilities
+ */
+ void set_speech_capabilities(
+ const smart_objects::SmartObject& speech_capabilities) OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the speech capabilities
+ *
+ * @return Currently supported speech capabilities
+ */
+ const smart_objects::SmartObject* speech_capabilities() const OVERRIDE;
+
+ /*
+ * @brief Sets supported VR capabilities
+ *
+ * @param vr_capabilities supported VR capabilities
+ */
+ void set_vr_capabilities(
+ const smart_objects::SmartObject& vr_capabilities) OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the VR capabilities
+ *
+ * @return Currently supported VR capabilities
+ */
+ const smart_objects::SmartObject* vr_capabilities() const OVERRIDE;
+
+ /*
+ * @brief Sets supported audio_pass_thru capabilities
+ *
+ * @param vr_capabilities supported audio_pass_thru capabilities
+ */
+ void set_audio_pass_thru_capabilities(
+ const smart_objects::SmartObject& audio_pass_thru_capabilities) OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the audio_pass_thru capabilities
+ *
+ * @return Currently supported audio_pass_thru capabilities
+ */
+ const smart_objects::SmartObject* audio_pass_thru_capabilities()
+ const OVERRIDE;
+
+ /*
+ * @brief Sets supported pcm_stream capabilities
+ *
+ * @param supported pcm_stream capabilities
+ */
+ void set_pcm_stream_capabilities(
+ const smart_objects::SmartObject& pcm_stream_capabilities) OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the pcm_stream capabilities
+ *
+ * @return Currently supported pcm_streaming capabilities
+ */
+ const smart_objects::SmartObject* pcm_stream_capabilities() const OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the preset bank capabilities
+ *
+ * @return Currently supported preset bank capabilities
+ */
+ const smart_objects::SmartObject* preset_bank_capabilities() const OVERRIDE;
+
+ /*
+ * @brief Sets supported preset bank capabilities
+ *
+ * @param soft_button_capabilities supported preset bank capabilities
+ */
+ void set_preset_bank_capabilities(
+ const smart_objects::SmartObject& preset_bank_capabilities) OVERRIDE;
+
+ /*
+ * @brief Sets vehicle information(make, model, modelYear)
+ *
+ * @param vehicle_type Cuurent vehicle information
+ */
+ void set_vehicle_type(
+ const smart_objects::SmartObject& vehicle_type) OVERRIDE;
+
+ /*
+ * @brief Retrieves vehicle information(make, model, modelYear)
+ *
+ * @param vehicle_type Cuurent vehicle information
+ */
+ const smart_objects::SmartObject* vehicle_type() const OVERRIDE;
+
+ /*
+ * @brief Retrieves information about the prerecorded speech
+ *
+ * @return Currently supported prerecorded speech
+ */
+ const smart_objects::SmartObject* prerecorded_speech() const OVERRIDE;
+
+ /*
+ * @brief Sets supported prerecorded speech
+ *
+ * @param prerecorded_speech supported prerecorded speech
+ */
+ void set_prerecorded_speech(
+ const smart_objects::SmartObject& prerecorded_speech) OVERRIDE;
+
+ /*
+ * @brief Interface used to store information if navigation
+ * supported by the system
+ *
+ * @param supported Indicates if navigation supported by the system
+ */
+ void set_navigation_supported(const bool supported) OVERRIDE;
+
+ /*
+ * @brief Retrieves information if navi supported by the system
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ bool navigation_supported() const OVERRIDE;
+
+ /*
+ * @brief Interface used to store information if phone call
+ * supported by the system
+ *
+ * @param supported Indicates if navigation supported by the sustem
+ */
+ void set_phone_call_supported(const bool supported) OVERRIDE;
+
+ /*
+ * @brief Retrieves information if phone call supported by the system
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ bool phone_call_supported() const OVERRIDE;
+
+ void Init(resumption::LastState* last_state) OVERRIDE;
+
+ /*
+ * @brief return component which follows for correctness of
+ * languages
+ * @return HMI language handler
+ */
+ HMILanguageHandler& get_hmi_language_handler() OVERRIDE;
+
+ /**
+ * @brief Trigger waiting for response
+ * @param request Request object
+ */
+ void set_handle_response_for(
+ const smart_objects::SmartObject& request) OVERRIDE;
+
+ protected:
+ /*
+ * @brief Loads capabilities from local file in case SDL was launched
+ * without HMI
+ *
+ * @return TRUE if capabilities loaded successfully, otherwise FALSE.
+ */
+ bool load_capabilities_from_file();
+
+ /*
+ * @brief function checks if json member exists
+ *
+ * @param json_member from file hmi_capabilities.json
+ * @param name_of_member name which we should check
+ * hmi_capabilities.json
+ *
+ * @returns TRUE if member exists and returns FALSE if
+ * member does not exist.
+ */
+ bool check_existing_json_member(const Json::Value& json_member,
+ const char* name_of_member) const OVERRIDE;
+
+ /*
+ * @brief function converts json object "languages" to smart object
+ *
+ * @param json_languages from file hmi_capabilities.json
+ * @param languages - the converted object
+ *
+ */
+ void convert_json_languages_to_obj(
+ const Json::Value& json_languages,
+ smart_objects::SmartObject& languages) const OVERRIDE;
+
+ private:
+ bool is_vr_cooperating_;
+ bool is_tts_cooperating_;
+ bool is_ui_cooperating_;
+ bool is_navi_cooperating_;
+ bool is_ivi_cooperating_;
+
+ bool attenuated_supported_;
+ hmi_apis::Common_Language::eType ui_language_;
+ hmi_apis::Common_Language::eType vr_language_;
+ hmi_apis::Common_Language::eType tts_language_;
+ smart_objects::SmartObject* vehicle_type_;
+ smart_objects::SmartObject* ui_supported_languages_;
+ smart_objects::SmartObject* tts_supported_languages_;
+ smart_objects::SmartObject* vr_supported_languages_;
+ smart_objects::SmartObject* display_capabilities_;
+ smart_objects::SmartObject* hmi_zone_capabilities_;
+ smart_objects::SmartObject* soft_buttons_capabilities_;
+ smart_objects::SmartObject* button_capabilities_;
+ smart_objects::SmartObject* preset_bank_capabilities_;
+ smart_objects::SmartObject* vr_capabilities_;
+ smart_objects::SmartObject* speech_capabilities_;
+ smart_objects::SmartObject* audio_pass_thru_capabilities_;
+ smart_objects::SmartObject* pcm_stream_capabilities_;
+ smart_objects::SmartObject* prerecorded_speech_;
+ bool is_navigation_supported_;
+ bool is_phone_call_supported_;
+ std::string ccpu_version_;
+
+ ApplicationManager& app_mngr_;
+ HMILanguageHandler hmi_language_handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(HMICapabilitiesImpl);
+};
+
+} // namespace application_manager
+
+#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
new file mode 100644
index 0000000000..df1e2a9067
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @brief The class contains information about state HMI's interfaces
+ * (Buttons, BasicCommunication, VR, TTS, UI, Navigation,VehicleInfo,
+ * SDL) and provides this information through public interfaces.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_H_
+
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+/**
+ * @brief The class contains information about state HMI's interfaces
+ * (Buttons, BasicCommunication, VR, TTS, UI, Navigation,VehicleInfo,
+ * SDL) and provides this information through public interfaces.
+ */
+class HmiInterfaces {
+ public:
+ enum InterfaceID {
+ HMI_INTERFACE_INVALID_ENUM,
+ HMI_INTERFACE_Buttons,
+ HMI_INTERFACE_BasicCommunication,
+ HMI_INTERFACE_VR,
+ HMI_INTERFACE_TTS,
+ HMI_INTERFACE_UI,
+ HMI_INTERFACE_Navigation,
+ HMI_INTERFACE_VehicleInfo,
+ HMI_INTERFACE_SDL
+ };
+
+ /**
+ * @brief The InterfaceState enum handle possible states of HMI interfaces
+ * STATE_NOT_RESPONSE - HMI didn't not responsed IsReady on Inerface
+ * STATE_AVAILABLE - Hmi responsed IsReady(avaliable = true)
+ * STATE_NOT_AVAILABLE - Hmi responsed IsReady(avaliable = false)
+ */
+ enum InterfaceState {
+ STATE_NOT_RESPONSE,
+ STATE_AVAILABLE,
+ STATE_NOT_AVAILABLE
+ };
+
+ /**
+ * @brief GetInterfaceState return currecnt state of hmi interface
+ * @param interface to get state
+ * @return state of interface
+ */
+ virtual InterfaceState GetInterfaceState(InterfaceID interface) const = 0;
+
+ /**
+ * @brief SetInterfaceState set interface to some state
+ * @param interface interface to set state
+ * @param state to setup
+ */
+ virtual InterfaceID GetInterfaceFromFunction(
+ hmi_apis::FunctionID::eType function) const = 0;
+
+ /**
+ * @brief GetInterfaceFromFunction extract interface name fron function id
+ * @param function to extract interface name
+ * @return extracted interface name
+ */
+ virtual void SetInterfaceState(InterfaceID interface,
+ InterfaceState state) = 0;
+ virtual ~HmiInterfaces() {}
+};
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h b/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h
new file mode 100644
index 0000000000..2b2d1e1361
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_IMPL_H_
+#include <map>
+#include "application_manager/hmi_interfaces.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+/**
+ * @brief The HmiInterfacesImpl class handles
+ * hmi interfaces states
+ */
+namespace application_manager {
+
+class HmiInterfacesImpl : public HmiInterfaces {
+ public:
+ HmiInterfacesImpl();
+
+ /**
+ * @brief GetInterfaceState return currecnt state of hmi interface
+ * @param interface to get state
+ * @return state of interface
+ */
+ InterfaceState GetInterfaceState(InterfaceID interface) const OVERRIDE;
+
+ /**
+ * @brief SetInterfaceState set interface to some state
+ * @param interface interface to set state
+ * @param state to setup
+ */
+ void SetInterfaceState(InterfaceID interface, InterfaceState state) OVERRIDE;
+
+ /**
+ * @brief GetInterfaceFromFunction extract interface name fron function id
+ * @param function to extract interface name
+ * @return extracted interface name
+ */
+ InterfaceID GetInterfaceFromFunction(
+ hmi_apis::FunctionID::eType function) const OVERRIDE;
+
+ private:
+ typedef std::map<InterfaceID, InterfaceState> InterfaceStatesMap;
+ InterfaceStatesMap interfaces_states_;
+ mutable sync_primitives::Lock interfaces_states_lock_;
+};
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_IMPL_H_
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..799fdff67d 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -30,8 +30,8 @@
* 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"
@@ -301,4 +301,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..fe903393fb 100644
--- a/src/components/application_manager/include/application_manager/message.h
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -41,8 +41,6 @@
#include "protocol/rpc_type.h"
#include "smart_objects/smart_object.h"
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
namespace application_manager {
typedef std::vector<uint8_t> BinaryData;
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 ab89883ad2..8d10511d66 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -46,12 +46,7 @@
#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 +54,6 @@ class PolicyHandlerInterface;
namespace application_manager {
namespace mobile_api = mobile_apis;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
/*
* @brief Typedef for VehicleData
@@ -103,6 +97,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 +137,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 +180,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
@@ -269,8 +272,6 @@ class MessageHelper {
*/
static void SendUIChangeRegistrationRequestToHMI(
ApplicationConstSharedPtr app, ApplicationManager& app_mngr);
- static void SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr);
static void SendAddVRCommandToHMI(
uint32_t cmd_id,
const smart_objects::SmartObject& vr_commands,
@@ -342,11 +343,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);
@@ -360,15 +361,24 @@ 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 notification to HMI to start video streaming
@@ -520,6 +530,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
*
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..e2c4d73f5c 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,15 +94,20 @@ 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(
@@ -110,12 +117,14 @@ class PolicyHandler : public PolicyHandlerInterface,
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;
+ uint32_t TimeoutExchangeSec() OVERRIDE;
+ uint32_t TimeoutExchangeMSec() OVERRIDE;
void OnExceededTimeout() OVERRIDE;
void OnSystemReady() OVERRIDE;
void PTUpdatedAt(Counters counter, int value) OVERRIDE;
@@ -150,11 +159,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 +194,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 +314,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 +328,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 +348,11 @@ class PolicyHandler : public 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
*/
- 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 +387,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,30 +422,33 @@ 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) {
policy_manager_ = pm;
}
+
+ AppIds& last_used_app_ids() {
+ return last_used_app_ids_;
+ }
#endif // BUILD_TESTS
#ifdef ENABLE_SECURITY
@@ -412,6 +457,8 @@ class PolicyHandler : public PolicyHandlerInterface,
const PolicySettings& get_settings() const OVERRIDE;
+ virtual void OnPTUFinished(const bool ptu_result) OVERRIDE;
+
protected:
/**
* Starts next retry exchange policy table
@@ -439,21 +486,58 @@ 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
/**
* @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 +546,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,9 +573,39 @@ 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_;
@@ -508,11 +622,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 +639,20 @@ 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 237d9f5d8a..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 {
@@ -139,11 +140,13 @@ class RequestController {
*
* @param correlation_id Active request correlation ID,
* @param connection_key Active request connection key (0 for HMI requersts)
+ * @param function_id Active request function id
* @param force_terminate if true, request controller will terminate
* even if not allowed by request
*/
- void terminateRequest(const uint32_t& correlation_id,
- const uint32_t& connection_key,
+ void TerminateRequest(const uint32_t correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id,
bool force_terminate = false);
/**
@@ -152,8 +155,9 @@ class RequestController {
* @param mobile_correlation_id Active mobile request correlation ID
*
*/
- void OnMobileResponse(const uint32_t& mobile_correlation_id,
- const uint32_t& connection_key);
+ void OnMobileResponse(const uint32_t mobile_correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id);
/**
* @brief Removes request from queue
@@ -161,7 +165,7 @@ class RequestController {
* @param mobile_correlation_id Active mobile request correlation ID
*
*/
- void OnHMIResponse(const uint32_t& correlation_id);
+ void OnHMIResponse(const uint32_t correlation_id, const int32_t function_id);
/**
* @ Add notification to collection
@@ -213,25 +217,28 @@ class RequestController {
protected:
/**
- * @brief Timer Callback
+ * @brief Timer callback which handles all request timeouts
*/
- void onTimer();
+ void TimeoutThread();
/**
- * @brief Update timout for next OnTimer
- * Not thread safe
+ * @brief Signal timer condition variable
*/
- void UpdateTimer();
+ void NotifyTimer();
void terminateWaitingForExecutionAppRequests(const uint32_t& app_id);
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
@@ -272,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_;
@@ -281,6 +294,13 @@ class RequestController {
*/
timer::Timer timer_;
+ /*
+ * Timer for lock
+ */
+ bool timer_stop_flag_;
+ sync_primitives::Lock timer_lock;
+ sync_primitives::ConditionalVariable timer_condition_;
+
bool is_low_voltage_;
const RequestControlerSettings& settings_;
DISALLOW_COPY_AND_ASSIGN(RequestController);
diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h
index 0d4a147bda..5ebcac71f8 100644
--- a/src/components/application_manager/include/application_manager/request_info.h
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -60,7 +60,6 @@ struct RequestInfo {
RequestInfo()
: timeout_msec_(0)
, app_id_(0)
- , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, requst_type_(RequestNone)
, correlation_id_(0) {
start_time_ = date_time::DateTime::getCurrentTime();
@@ -71,10 +70,7 @@ struct 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)
- , correlation_id_(0) {
+ : request_(request), timeout_msec_(timeout_msec), correlation_id_(0) {
start_time_ = date_time::DateTime::getCurrentTime();
updateEndTime();
requst_type_ = requst_type;
@@ -115,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_;
}
@@ -144,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_;
};
@@ -243,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
@@ -338,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 853f91ff23..26b1739a38 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
@@ -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
@@ -30,28 +30,20 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_
#include <stdint.h>
-#include <vector>
-#include <map>
-#include <set>
-#include <list>
-
-#include "interfaces/HMI_API.h"
-#include "interfaces/HMI_API_schema.h"
-#include "interfaces/MOBILE_API_schema.h"
-#include "application_manager/event_engine/event_observer.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/application.h"
+#include "utils/shared_ptr.h"
#include "application_manager/resumption/resumption_data.h"
-#include "utils/timer.h"
namespace application_manager {
class ApplicationManager;
class Application;
+typedef utils::SharedPtr<Application> ApplicationSharedPtr;
+typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
}
+namespace app_mngr = application_manager;
namespace resumption {
@@ -61,50 +53,40 @@ class LastState;
* @brief Contains logic for storage/restore data of applications.
*/
-class ResumeCtrl : public application_manager::event_engine::EventObserver {
+class ResumeCtrl {
public:
/**
- * @brief allows to create ResumeCtrl object
- */
- ResumeCtrl(application_manager::ApplicationManager& application_manager);
-
- /**
* @brief allows to destroy ResumeCtrl object
*/
- ~ResumeCtrl();
-
- /**
- * @brief Event, that raised if application get resumption response from HMI
- * @param event : event object, that contains smart_object with HMI message
- */
- virtual void on_event(const application_manager::event_engine::Event& event);
+ virtual ~ResumeCtrl() {}
/**
* @brief Save all applications info to the file system
*/
- void SaveAllApplications();
+ virtual void SaveAllApplications() = 0;
/**
* @brief Save application persistent info for future resuming
* @param application is application witch need to be saved
*/
- void SaveApplication(application_manager::ApplicationSharedPtr application);
+ virtual void SaveApplication(
+ application_manager::ApplicationSharedPtr application) = 0;
/**
* @brief Set application HMI Level and ausio_state as saved
* @param application is application witch HMI Level is need to restore
* @return true if success, otherwise return false
*/
- bool RestoreAppHMIState(
- application_manager::ApplicationSharedPtr application);
+ virtual bool RestoreAppHMIState(
+ application_manager::ApplicationSharedPtr application) = 0;
/**
* @brief Set application HMI Level as stored in policy
* @param application is application witch HMI Level is need to setup
* @return true if success, otherwise return false
*/
- bool SetupDefaultHMILevel(
- application_manager::ApplicationSharedPtr application);
+ virtual bool SetupDefaultHMILevel(
+ application_manager::ApplicationSharedPtr application) = 0;
/**
* @brief Setup HmiLevel for application
@@ -115,55 +97,34 @@ class ResumeCtrl : public application_manager::event_engine::EventObserver {
* @param check_policy indicate if policy data consent must be verified
* @return true if success, otherwise return false
*/
- bool SetAppHMIState(application_manager::ApplicationSharedPtr application,
- const mobile_apis::HMILevel::eType hmi_level,
- bool check_policy = true);
-
- /**
- * @brief Check if Resume controller have saved instance of application
- * @param application is application witch need to be checked
- * @return true if exist, false otherwise
- */
- bool ApplicationIsSaved(
- application_manager::ApplicationConstSharedPtr application);
+ virtual bool SetAppHMIState(
+ application_manager::ApplicationSharedPtr application,
+ const mobile_apis::HMILevel::eType hmi_level,
+ bool check_policy = true) = 0;
/**
* @brief Remove application from list of saved applications
* @param application is application which need to be removed
* @return return true, if success, otherwise return false
*/
- bool RemoveApplicationFromSaved(
- application_manager::ApplicationConstSharedPtr application);
-
- /**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- void OnSuspend();
-
+ virtual bool RemoveApplicationFromSaved(
+ app_mngr::ApplicationConstSharedPtr application) = 0;
/**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
+ * @brief Processes resumption data after receiving signal "Suspend"
*/
- void OnAwake();
+ virtual void OnSuspend() = 0;
/**
- * @brief Method starts timer "RsmCtrlPercist" when
- * SDL receives onAwakeSDL notification
+ * @brief Processes resumption data after receiving signal "Awake"
*/
- void StartSavePersistentDataTimer();
+ virtual void OnAwake() = 0;
/**
* @brief Method stops timer "RsmCtrlPercist" when SDL
* receives OnExitAllApplication notification
* with reason "SUSPEND"
*/
- void StopSavePersistentDataTimer();
-
- /**
- * @brief Method stops restore_hmi_level_timer_ "RsmCtrlRstore" in OnSuspend()
- */
- void StopRestoreHmiLevelTimer();
+ virtual void StopSavePersistentDataTimer() = 0;
/**
* @brief Start timer for resumption applications
@@ -171,41 +132,39 @@ class ResumeCtrl : public application_manager::event_engine::EventObserver {
* @param application that is need to be restored
* @return true if it was saved, otherwise return false
*/
- bool StartResumption(application_manager::ApplicationSharedPtr application,
- const std::string& hash);
-
+ virtual bool StartResumption(app_mngr::ApplicationSharedPtr application,
+ const std::string& hash) = 0;
/**
* @brief Start timer for resumption applications
* Does not restore D1-D5 data
* @param application that is need to be restored
* @return true if it was saved, otherwise return false
*/
- bool StartResumptionOnlyHMILevel(
- application_manager::ApplicationSharedPtr application);
+ virtual bool StartResumptionOnlyHMILevel(
+ app_mngr::ApplicationSharedPtr application) = 0;
/**
* @brief Check if there are all files need for resumption
* @param application that is need to be restored
* @return true if it all files exist, otherwise return false
*/
- bool CheckPersistenceFilesForResumption(
- application_manager::ApplicationSharedPtr application);
+ virtual bool CheckPersistenceFilesForResumption(
+ app_mngr::ApplicationSharedPtr application) = 0;
/**
* @brief Check application hash
* @param application that is need to be restored
* @return true if it was saved, otherwise return false
*/
- bool CheckApplicationHash(
- application_manager::ApplicationSharedPtr application,
- const std::string& hash);
+ virtual bool CheckApplicationHash(app_mngr::ApplicationSharedPtr application,
+ const std::string& hash) = 0;
/**
* @brief Checks if Resume controller have saved application with hmi app id
* @param hmi_app_id - hmi application id
* @return true if exist, false otherwise
*/
- bool IsHMIApplicationIdExist(uint32_t hmi_app_id);
+ virtual bool IsHMIApplicationIdExist(uint32_t hmi_app_id) = 0;
/**
* @brief Check if Resume controller have saved instance of application
@@ -213,8 +172,8 @@ class ResumeCtrl : public application_manager::event_engine::EventObserver {
* @param device_id - id of device where application is run
* @return true if exist, false otherwise
*/
- bool IsApplicationSaved(const std::string& policy_app_id,
- const std::string& device_id);
+ virtual bool IsApplicationSaved(const std::string& policy_app_id,
+ const std::string& device_id) = 0;
/**
* @brief Function is used for application resume. HMI app ID must be
@@ -224,283 +183,75 @@ class ResumeCtrl : public application_manager::event_engine::EventObserver {
* @param device_id - id of device where application is run
* @return HMI app ID
*/
- uint32_t GetHMIApplicationID(const std::string& policy_app_id,
- const std::string& device_id) const;
- /**
- * @brief SaveDataOnTimer :
- * Timer callback for persisting ResumptionData each N seconds
- * N gets from property
- */
- void SaveDataOnTimer();
+ virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id,
+ const std::string& device_id) const = 0;
/**
* @brief Updates flag for saving application data
*/
- void ApplicationsDataUpdated() {
- is_data_saved_ = false;
- }
+ virtual void ApplicationsDataUpdated() = 0;
/**
* @brief Resume HMI Level and audio streaming state if needed
* @param application - application to restore hmi level
* and audio streaming state
*/
- void StartAppHmiStateResumption(
- application_manager::ApplicationSharedPtr application);
+ virtual void StartAppHmiStateResumption(
+ application_manager::ApplicationSharedPtr application) = 0;
/**
* @brief Update launch_time_ to current
*/
- void ResetLaunchTime();
-
- /**
- * @brief Timer callback for restoring HMI Level
- *
- */
- void ApplicationResumptiOnTimer();
+ virtual void ResetLaunchTime() = 0;
/**
* @brief Removes activated application from resumption list
*
* @param application application witch need to be removed from resumption
*/
- void OnAppActivated(application_manager::ApplicationSharedPtr application);
+ virtual void OnAppActivated(app_mngr::ApplicationSharedPtr application) = 0;
/**
* @brief Removes app from resumption list
*
* app_id Application to remove
*/
- void RemoveFromResumption(uint32_t app_id);
+ virtual void RemoveFromResumption(uint32_t app_id) = 0;
/**
* @brief Initialization data for Resume controller
* @return true if initialization is success otherwise
* returns false
*/
- bool Init(LastState& last_state);
+ virtual bool Init(LastState& last_state) = 0;
/**
* @brief Notify resume controller about new application
* @param policy_app_id - mobile application id
* @param device_id - id of device where application is run
*/
- void OnAppRegistrationStart(const std::string& policy_app_id,
- const std::string& device_id);
+ virtual void OnAppRegistrationStart(const std::string& policy_app_id,
+ const std::string& device_id) = 0;
/**
* @brief Notify resume controller about delete new application
*/
- void OnAppRegistrationEnd();
-
-#ifdef BUILD_TESTS
- void set_resumption_storage(utils::SharedPtr<ResumptionData> mock_storage);
-#endif // BUILD_TESTS
- private:
- /**
- * @brief restores saved data of application
- * @param application contains application for which restores data
- * @return true if success, otherwise return false
- */
- bool RestoreApplicationData(
- application_manager::ApplicationSharedPtr application);
-
- /**
- * @brief AddFiles allows to add files for the application
- * which should be resumed
- * @param application application which will be resumed
- * @param saved_app application specific section from backup file
- */
- void AddFiles(application_manager::ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app);
-
- /**
- * @brief AddSubmenues allows to add sub menues for the application
- * which should be resumed
- * @param application application which will be resumed
- * @param saved_app application specific section from backup file
- */
- void AddSubmenues(application_manager::ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app);
-
- /**
- * @brief AddCommands allows to add commands for the application
- * which should be resumed
- * @param application application which will be resumed
- * @param saved_app application specific section from backup file
- */
- void AddCommands(application_manager::ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app);
-
- /**
- * @brief AddChoicesets allows to add choice sets for the application
- * which should be resumed
- * @param application application which will be resumed
- * @param saved_app application specific section from backup file
- */
- void AddChoicesets(application_manager::ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app);
-
- /**
- * @brief SetGlobalProperties allows to restore global properties.
- * @param application application which will be resumed
- * @param saved_app application specific section from backup file
- */
- void SetGlobalProperties(
- application_manager::ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app);
-
- /**
- * @brief AddSubscriptions allows to restore subscriptions
- * @param application application which will be resumed
- * @param saved_app application specific section from backup file
- */
- void AddSubscriptions(application_manager::ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app);
-
- /**
- * @brief AddWayPointsSubscription allows to restore subscription
- * for WayPoints
- * @param application application which will be resumed
- * @param saved_app application specific section from backup file
- */
- void AddWayPointsSubscription(
- application_manager::ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app);
-
- bool CheckIgnCycleRestrictions(const smart_objects::SmartObject& saved_app);
-
- bool DisconnectedJustBeforeIgnOff(
- const smart_objects::SmartObject& saved_app);
-
- bool CheckAppRestrictions(
- application_manager::ApplicationConstSharedPtr application,
- const smart_objects::SmartObject& saved_app);
-
- /**
- * @brief CheckIcons allows to check application icons
- * @param application application under resumtion application
- * @param json_object
- * @return true in case icons exists, false otherwise
- */
- bool CheckIcons(application_manager::ApplicationSharedPtr application,
- smart_objects::SmartObject& obj);
-
- /**
- * @brief CheckDelayAfterIgnOn should check if SDL was started less
- * then N secconds ago. N will be readed from profile.
- * @return true if SDL started N secconds ago, otherwise return false
- */
- bool CheckDelayAfterIgnOn();
-
- typedef std::pair<uint32_t, uint32_t> ApplicationTimestamp;
-
- std::set<application_manager::ApplicationSharedPtr> retrieve_application();
+ virtual void OnAppRegistrationEnd() = 0;
/**
- * @brief This struct need to map
- * timestamp and application from correlationID
+ * @brief GetSavedHMILevels get saved apps hmi levels
+ * @return mapping of mobile application id and saved hmi_level
*/
- struct ResumingApp {
- uint32_t old_session_key; // session key is the same as app_id
- application_manager::ApplicationSharedPtr app;
- };
-
- struct TimeStampComparator {
- bool operator()(const ApplicationTimestamp& lhs,
- const ApplicationTimestamp& rhs) const {
- return lhs.second < rhs.second;
- }
- };
+ virtual int32_t GetSavedAppHmiLevel(const std::string& app_id,
+ const std::string& device_id) const = 0;
- /**
- * @brief geter for launch_time_
- * @return value of launch_time_
- */
- time_t launch_time() const;
-
- /**
- * @brief Check device MAC address
- * @param application that is need to be restored
- * @param saved_device_mac Saved device MAC address
- * @return TRUE on success, otherwise FALSE
- */
- bool IsDeviceMacAddressEqual(
- application_manager::ApplicationSharedPtr application,
- const std::string& saved_device_mac);
-
- /**
- * @brief Get the last ignition off time from LastState
- * @return the last ignition off time from LastState
- */
- time_t GetIgnOffTime();
+ virtual time_t LaunchTime() const = 0;
- /**
- * @brief Setup IgnOff time to LastState
- * @param ign_off_time - igition off time
- */
- void SetLastIgnOffTime(time_t ign_off_time);
-
- /**
- * @brief Process specified HMI request
- * @param request Request to process
- * @param use_events Process request events or not flag
- * @return TRUE on success, otherwise FALSE
- */
- bool ProcessHMIRequest(smart_objects::SmartObjectSPtr request = NULL,
- bool use_events = false);
-
- /**
- * @brief Process list of HMI requests using ProcessHMIRequest method
- * @param requests List of requests to process
- */
- void ProcessHMIRequests(const smart_objects::SmartObjectList& requests);
-
- void InsertToTimerQueue(uint32_t app_id, uint32_t time_stamp);
-
- void AddToResumptionTimerQueue(const uint32_t app_id);
-
- void LoadResumeData();
-
- /**
- * @brief Checks, if application data needs to be resumed
- * @param application Application data from storage
- * @return true, if data resumption must be skipped, otherwise - false
- */
- bool IsAppDataResumptionExpired(
- const smart_objects::SmartObject& application) const;
- /**
- * @brief Checks from resume data, if application has been disconnected
- * unexpectedly
- * @param app Application section from resume data
- * @return true, if it has been unexpectedly disconnected, otherwise - false
- */
- bool IsUnexpectedlyDisconnected(const smart_objects::SmartObject& app) const;
-
- /**
- * @brief Checks, if application can be resumed
- * @param application Application
- * @return true, if no restrictions currently, otherwise - false
- */
- bool IsResumeAllowed(
- const application_manager::ApplicationSharedPtr application) const;
-
- /**
- *@brief Mapping applications to time_stamps
- * wait for timer to resume HMI Level
- *
- */
- mutable sync_primitives::Lock queue_lock_;
- timer::Timer restore_hmi_level_timer_;
- timer::Timer save_persistent_data_timer_;
- typedef std::list<uint32_t> WaitingForTimerList;
- WaitingForTimerList waiting_for_timer_;
- bool is_resumption_active_;
- bool is_data_saved_;
- time_t launch_time_;
- utils::SharedPtr<ResumptionData> resumption_storage_;
- application_manager::ApplicationManager& application_manager_;
+#ifdef BUILD_TESTS
+ virtual void set_resumption_storage(
+ utils::SharedPtr<ResumptionData> mock_storage) = 0;
+#endif // BUILD_TESTS
};
} // namespace resumption
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_
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
new file mode 100644
index 0000000000..bb886cd5f6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
@@ -0,0 +1,500 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
+
+#include <stdint.h>
+#include <vector>
+#include <map>
+#include <set>
+#include <list>
+
+#include "interfaces/HMI_API.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/application.h"
+#include "application_manager/resumption/resumption_data.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "utils/timer.h"
+
+namespace resumption {
+
+class LastState;
+
+/**
+ * @brief Contains logic for storage/restore data of applications.
+ */
+
+class ResumeCtrlImpl : public ResumeCtrl,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief allows to create ResumeCtrlImpl object
+ */
+ ResumeCtrlImpl(application_manager::ApplicationManager& application_manager);
+
+ /**
+ * @brief allows to destroy ResumeCtrlImpl object
+ */
+ ~ResumeCtrlImpl();
+
+ /**
+ * @brief Event, that raised if application get resumption response from HMI
+ * @param event : event object, that contains smart_object with HMI message
+ */
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief Save all applications info to the file system
+ */
+ void SaveAllApplications() OVERRIDE;
+
+ /**
+ * @brief Save application persistent info for future resuming
+ * @param application is application witch need to be saved
+ */
+ void SaveApplication(app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief Set application HMI Level and ausio_state as saved
+ * @param application is application witch HMI Level is need to restore
+ * @return true if success, otherwise return false
+ */
+ bool RestoreAppHMIState(app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief Set application HMI Level as stored in policy
+ * @param application is application witch HMI Level is need to setup
+ * @return true if success, otherwise return false
+ */
+ bool SetupDefaultHMILevel(
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief Setup HmiLevel for application
+ * Do routine of setting up hmi_level
+ * @param application is application witch HMI Level is need to setup
+ * @param hmi_level HMI Level is needed to setup
+ * @param hmi_level AudioStreamingState is needed to setup
+ * @param check_policy indicate if policy data consent must be verified
+ * @return true if success, otherwise return false
+ */
+ bool SetAppHMIState(app_mngr::ApplicationSharedPtr application,
+ const mobile_apis::HMILevel::eType hmi_level,
+ bool check_policy = true) OVERRIDE;
+
+ /**
+ * @brief Remove application from list of saved applications
+ * @param application is application which need to be removed
+ * @return return true, if success, otherwise return false
+ */
+ bool RemoveApplicationFromSaved(
+ app_mngr::ApplicationConstSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief Processes resumption data after receiving signal "Suspend"
+ */
+ void OnSuspend() OVERRIDE;
+
+ /**
+ * @brief Processes resumption data after receiving signal "Awake"
+ */
+ void OnAwake() OVERRIDE;
+
+ /**
+ * @brief Method stops timer "RsmCtrlPercist" when SDL
+ * receives OnExitAllApplication notification
+ * with reason "SUSPEND"
+ */
+ void StopSavePersistentDataTimer() OVERRIDE;
+
+ /**
+ * @brief Method stops restore_hmi_level_timer_ "RsmCtrlRstore" in OnSuspend()
+ */
+ void StopRestoreHmiLevelTimer();
+
+ /**
+ * @brief Start timer for resumption applications
+ * Restore D1-D5 data
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool StartResumption(app_mngr::ApplicationSharedPtr application,
+ const std::string& hash) OVERRIDE;
+
+ /**
+ * @brief Start timer for resumption applications
+ * Does not restore D1-D5 data
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool StartResumptionOnlyHMILevel(
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief Check if there are all files need for resumption
+ * @param application that is need to be restored
+ * @return true if it all files exist, otherwise return false
+ */
+ bool CheckPersistenceFilesForResumption(
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief Check application hash
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool CheckApplicationHash(app_mngr::ApplicationSharedPtr application,
+ const std::string& hash) OVERRIDE;
+
+ /**
+ * @brief Checks if Resume controller have saved application with hmi app id
+ * @param hmi_app_id - hmi application id
+ * @return true if exist, false otherwise
+ */
+ bool IsHMIApplicationIdExist(uint32_t hmi_app_id) OVERRIDE;
+
+ /**
+ * @brief Check if Resume controller have saved instance of application
+ * @param policy_app_id - mobile application id
+ * @param device_id - id of device where application is run
+ * @return true if exist, false otherwise
+ */
+ bool IsApplicationSaved(const std::string& policy_app_id,
+ const std::string& device_id) OVERRIDE;
+
+ /**
+ * @brief Function is used for application resume. HMI app ID must be
+ * the same(PASA VCA module use it for stored app info).
+ * Retrieves HMI app ID for the given policy app ID from stored information.
+ * @param policy_app_id - mobile application id
+ * @param device_id - id of device where application is run
+ * @return HMI app ID
+ */
+ uint32_t GetHMIApplicationID(const std::string& policy_app_id,
+ const std::string& device_id) const OVERRIDE;
+
+ /**
+ * @brief Updates flag for saving application data
+ */
+ void ApplicationsDataUpdated() OVERRIDE {
+ is_data_saved_ = false;
+ }
+
+ /**
+ * @brief Resume HMI Level and audio streaming state if needed
+ * @param application - application to restore hmi level
+ * and audio streaming state
+ */
+ void StartAppHmiStateResumption(
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief Update launch_time_ to current
+ */
+ void ResetLaunchTime() OVERRIDE;
+
+ /**
+ * @brief Removes activated application from resumption list
+ *
+ * @param application application witch need to be removed from resumption
+ */
+ void OnAppActivated(app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief Removes app from resumption list
+ *
+ * app_id Application to remove
+ */
+ void RemoveFromResumption(uint32_t app_id) OVERRIDE;
+
+ /**
+ * @brief Initialization data for Resume controller
+ * @return true if initialization is success otherwise
+ * returns false
+ */
+ bool Init(LastState& last_state) OVERRIDE;
+
+ /**
+ * @brief Notify resume controller about new application
+ * @param policy_app_id - mobile application id
+ * @param device_id - id of device where application is run
+ */
+ void OnAppRegistrationStart(const std::string& policy_app_id,
+ const std::string& device_id) OVERRIDE;
+
+ /**
+ * @brief Notify resume controller about delete new application
+ */
+ void OnAppRegistrationEnd() OVERRIDE;
+
+ int32_t GetSavedAppHmiLevel(const std::string& app_id,
+ const std::string& device_id) const OVERRIDE;
+
+ /**
+ * @brief geter for launch_time_
+ * @return value of launch_time_
+ */
+ time_t LaunchTime() const OVERRIDE;
+
+ /**
+ * @brief Timer callback for restoring HMI Level
+ *
+ */
+ void ApplicationResumptiOnTimer();
+
+ /**
+ * @brief Method starts timer "RsmCtrlPercist" when
+ * SDL receives onAwakeSDL notification
+ */
+ void StartSavePersistentDataTimer();
+
+#ifdef BUILD_TESTS
+ void set_resumption_storage(
+ utils::SharedPtr<ResumptionData> mock_storage) OVERRIDE;
+#endif // BUILD_TESTS
+ private:
+ /**
+ * @brief restores saved data of application
+ * @param application contains application for which restores data
+ * @return true if success, otherwise return false
+ */
+ bool RestoreApplicationData(app_mngr::ApplicationSharedPtr application);
+
+ /**
+ * @brief SaveDataOnTimer :
+ * Timer callback for persisting ResumptionData each N seconds
+ * N gets from property
+ */
+ void SaveDataOnTimer();
+
+ /**
+ * @brief AddFiles allows to add files for the application
+ * which should be resumed
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ */
+ void AddFiles(app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app);
+
+ /**
+ * @brief AddSubmenues allows to add sub menues for the application
+ * which should be resumed
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ */
+ void AddSubmenues(app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app);
+
+ /**
+ * @brief AddCommands allows to add commands for the application
+ * which should be resumed
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ */
+ void AddCommands(app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app);
+
+ /**
+ * @brief AddChoicesets allows to add choice sets for the application
+ * which should be resumed
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ */
+ void AddChoicesets(app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app);
+
+ /**
+ * @brief SetGlobalProperties allows to restore global properties.
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ */
+ void SetGlobalProperties(app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app);
+
+ /**
+ * @brief AddSubscriptions allows to restore subscriptions
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ */
+ void AddSubscriptions(app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app);
+
+ /**
+ * @brief AddWayPointsSubscription allows to restore subscription
+ * for WayPoints
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ */
+ void AddWayPointsSubscription(app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app);
+
+ bool CheckIgnCycleRestrictions(const smart_objects::SmartObject& saved_app);
+
+ bool DisconnectedJustBeforeIgnOff(
+ const smart_objects::SmartObject& saved_app);
+
+ bool CheckAppRestrictions(app_mngr::ApplicationConstSharedPtr application,
+ const smart_objects::SmartObject& saved_app);
+
+ /**
+ * @brief CheckIcons allows to check application icons
+ * @param application application under resumtion application
+ * @param json_object
+ * @return true in case icons exists, false otherwise
+ */
+ bool CheckIcons(app_mngr::ApplicationSharedPtr application,
+ smart_objects::SmartObject& obj);
+
+ /**
+ * @brief CheckDelayAfterIgnOn should check if SDL was started less
+ * then N seconds ago. N will be readed from profile.
+ * @return true if SDL started N seconds ago, otherwise return false
+ */
+ bool CheckDelayAfterIgnOn();
+
+ typedef std::pair<uint32_t, uint32_t> application_timestamp;
+
+ std::set<app_mngr::ApplicationSharedPtr> retrieve_application();
+
+ /**
+ * @brief This struct need to map
+ * timestamp and application from correlationID
+ */
+ struct ResumingApp {
+ uint32_t old_session_key; // session key is the same as app_id
+ app_mngr::ApplicationSharedPtr app;
+ };
+
+ struct TimeStampComparator {
+ bool operator()(const application_timestamp& lhs,
+ const application_timestamp& rhs) const {
+ return lhs.second < rhs.second;
+ }
+ };
+
+ /**
+ * @brief Check device MAC address
+ * @param application that is need to be restored
+ * @param saved_device_mac Saved device MAC address
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool IsDeviceMacAddressEqual(app_mngr::ApplicationSharedPtr application,
+ const std::string& saved_device_mac);
+
+ /**
+ * @brief Get the last ignition off time from LastState
+ * @return the last ignition off time from LastState
+ */
+ time_t GetIgnOffTime();
+
+ /**
+ * @brief Setup IgnOff time to LastState
+ * @param ign_off_time - igition off time
+ */
+ void SetLastIgnOffTime(time_t ign_off_time);
+
+ /**
+ * @brief Process specified HMI request
+ * @param request Request to process
+ * @param use_events Process request events or not flag
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ProcessHMIRequest(smart_objects::SmartObjectSPtr request = NULL,
+ bool use_events = false);
+
+ /**
+ * @brief Process list of HMI requests using ProcessHMIRequest method
+ * @param requests List of requests to process
+ */
+ void ProcessHMIRequests(const smart_objects::SmartObjectList& requests);
+
+ void InsertToTimerQueue(uint32_t app_id, uint32_t time_stamp);
+
+ /**
+ * @brief Add application to queue to restore HMI level
+ * @param time_stamp contains time when application was stored to resumption
+ * data
+ * @param app_id contains id of application
+ */
+ void AddToResumptionTimerQueue(const uint32_t app_id);
+
+ void LoadResumeData();
+
+ /**
+ * @brief Checks, if application data needs to be resumed
+ * @param application Application data from storage
+ * @return true, if data resumption must be skipped, otherwise - false
+ */
+ bool IsAppDataResumptionExpired(
+ const smart_objects::SmartObject& application) const;
+
+ /**
+ * @brief Checks from resume data, if application has been disconnected
+ * unexpectedly
+ * @param app Application section from resume data
+ * @return true, if it has been unexpectedly disconnected, otherwise - false
+ */
+ bool IsUnexpectedlyDisconnected(const smart_objects::SmartObject& app) const;
+
+ /**
+ * @brief Checks, if application can be resumed
+ * @param application Application
+ * @param time_stamp contain time when application was stored to resumption
+ * data
+ * @return true, if no restrictions currently, otherwise - false
+ */
+ bool IsResumeAllowed(
+ const application_manager::ApplicationSharedPtr application) const;
+
+ /**
+ *@brief Mapping applications to time_stamps
+ * wait for timer to resume HMI Level
+ *
+ */
+ mutable sync_primitives::Lock queue_lock_;
+ timer::Timer restore_hmi_level_timer_;
+ timer::Timer save_persistent_data_timer_;
+ typedef std::list<uint32_t> WaitingForTimerList;
+ WaitingForTimerList waiting_for_timer_;
+ bool is_resumption_active_;
+ bool is_data_saved_;
+ time_t launch_time_;
+ utils::SharedPtr<ResumptionData> resumption_storage_;
+ application_manager::ApplicationManager& application_manager_;
+};
+
+} // namespace resumption
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
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..aeb65b32b9 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
@@ -43,7 +43,6 @@ class ApplicationManagerSettings;
namespace resumption {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
namespace app_mngr = application_manager;
/**
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..862816bf87 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 {
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..d61baff7d2 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>
@@ -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/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index 1fda170c34..38c1b1d9cc 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
@@ -51,6 +51,12 @@ extern const char* msg_params;
extern const char* method_name;
extern const char* info;
extern const char* app_id;
+extern const char* bundle_id;
+extern const char* app_info;
+extern const char* app_launch;
+extern const char* app_launch_list;
+extern const char* app_launch_last_session;
+extern const char* policy_app_id;
extern const char* hmi_app_id;
extern const char* device_id;
extern const char* subscribed_for_way_points;
@@ -63,6 +69,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;
@@ -158,6 +165,8 @@ 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;
// PutFile
extern const char* sync_file_name;
@@ -301,6 +310,28 @@ 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;
} // namespace strings
namespace json {
@@ -374,6 +405,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/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_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
new file mode 100644
index 0000000000..481635d8e6
--- /dev/null
+++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.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 <iterator>
+#include <algorithm>
+#include <utility>
+#include <vector>
+#include "application_manager/app_launch/app_launch_ctrl_impl.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "connection_handler/connection_handler.h"
+#include "application_manager/application.h"
+#include "utils/timer_task_impl.h"
+#include "utils/make_shared.h"
+
+namespace app_launch {
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
+
+AppLaunchCtrlImpl::AppLaunchCtrlImpl(
+ AppLaunchData& data,
+ application_manager::ApplicationManager& app_mngr,
+ const AppLaunchSettings& settings)
+ : settings_(settings)
+ , app_launch_data_(data)
+ , resume_ctrl_(app_mngr.resume_controller())
+ , apps_launcher_(app_mngr.connection_handler(),
+ settings.max_number_of_ios_device(),
+ settings.app_launch_max_retry_attempt(),
+ settings.app_launch_retry_wait_time())
+ , device_apps_launcher_(app_mngr, apps_launcher_, settings) {}
+
+void AppLaunchCtrlImpl::OnAppRegistered(
+ const application_manager::Application& app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // TODO (AKutsan) : get device mac
+ ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ app.policy_app_id(), app.bundle_id(), app.mac_address());
+ apps_launcher_.OnLaunched(app_data);
+ app_launch_data_.AddApplicationData(*app_data);
+}
+
+ApplicationDataPtr GetAppFromHmiLevelPair(
+ const std::pair<int32_t, ApplicationDataPtr>& pair) {
+ return pair.second;
+}
+
+bool HmiLevelSorter(const std::pair<int32_t, ApplicationDataPtr>& lval,
+ const std::pair<int32_t, ApplicationDataPtr>& rval) {
+ if (lval.first == -1) {
+ return false;
+ }
+ if (rval.first == -1) {
+ return true;
+ }
+ return lval.first < rval.first;
+}
+
+void AppLaunchCtrlImpl::OnDeviceConnected(const std::string& device_mac) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<ApplicationDataPtr> apps_on_device =
+ app_launch_data_.GetApplicationDataByDevice(device_mac);
+ std::vector<std::pair<int32_t, ApplicationDataPtr> > apps_hmi_levels;
+ std::vector<ApplicationDataPtr>::iterator it = apps_on_device.begin();
+ for (; it != apps_on_device.end(); ++it) {
+ const ApplicationDataPtr& app_data = *it;
+ const int32_t hmi_level = resume_ctrl_.GetSavedAppHmiLevel(
+ app_data->mobile_app_id_, app_data->device_mac_);
+ const std::pair<int32_t, ApplicationDataPtr> hmi_level_app(hmi_level,
+ app_data);
+ apps_hmi_levels.push_back(hmi_level_app);
+ }
+ std::sort(apps_hmi_levels.begin(), apps_hmi_levels.end(), HmiLevelSorter);
+ apps_on_device.clear();
+ std::transform(apps_hmi_levels.begin(),
+ apps_hmi_levels.end(),
+ std::back_inserter(apps_on_device),
+ GetAppFromHmiLevelPair);
+ if (apps_on_device.size() > 0) {
+ device_apps_launcher_.LaunchAppsOnDevice(device_mac, apps_on_device);
+ } else {
+ LOG4CXX_DEBUG(logger_, "No apps in saved for device " << device_mac);
+ }
+}
+
+void AppLaunchCtrlImpl::OnMasterReset() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_launch_data_.Clear();
+}
+} // namespace app_launch
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_db.cc b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
new file mode 100644
index 0000000000..f3adfc749b
--- /dev/null
+++ b/src/components/application_manager/src/app_launch/app_launch_data_db.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 <string>
+#include <unistd.h>
+
+#include "application_manager/app_launch/app_launch_data_db.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/app_launch/app_launch_sql_queries.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/message_helper.h"
+#include "utils/make_shared.h"
+
+namespace app_launch {
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
+
+AppLaunchDataDB::AppLaunchDataDB(const AppLaunchSettings& settings,
+ DbStorage db_storage)
+ : AppLaunchDataImpl(settings) {
+ if (db_storage == In_File_Storage) {
+ db_.reset(new utils::dbms::SQLDatabase(kDatabaseName));
+#ifndef __QNX__
+ std::string path = settings_.app_storage_folder();
+ if (!path.empty()) {
+ db()->set_path(path + "/");
+ }
+ } else if (db_storage == In_Memory_Storage) {
+ db_.reset(new utils::dbms::SQLDatabase());
+#endif // __QNX__
+ DCHECK(db_.get());
+ } else {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_ERROR(logger_, "Get not existed type of database storage");
+ }
+
+ // Connect to resumption DB
+ init_successeful_ = Init();
+}
+
+AppLaunchDataDB::~AppLaunchDataDB() {
+ db()->Close();
+}
+
+bool AppLaunchDataDB::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!db()->Open()) {
+ LOG4CXX_ERROR(logger_, "Failed opening database.");
+ LOG4CXX_INFO(logger_, "Starting opening retries.");
+ const uint16_t attempts = settings_.app_launch_max_retry_attempt();
+ LOG4CXX_DEBUG(logger_, "Total attempts number is: " << attempts);
+ bool is_opened = false;
+ const uint16_t open_attempt_timeout_ms =
+ settings_.app_launch_retry_wait_time();
+ const useconds_t sleep_interval_mcsec = open_attempt_timeout_ms * 1000u;
+ LOG4CXX_DEBUG(logger_,
+ "Open attempt timeout(ms) is: " << open_attempt_timeout_ms);
+ for (size_t i = 0u; i < attempts; ++i) {
+ usleep(sleep_interval_mcsec);
+ LOG4CXX_INFO(logger_, "Attempt: " << i + 1);
+ if (db()->Open()) {
+ LOG4CXX_INFO(logger_, "Database opened.");
+ is_opened = true;
+ break;
+ }
+ }
+ if (!is_opened) {
+ LOG4CXX_ERROR(logger_,
+ "Open retry sequence failed. Tried "
+ << attempts << " attempts with "
+ << open_attempt_timeout_ms
+ << " open timeout(ms) for each.");
+ return false;
+ }
+ }
+#ifndef __QNX__
+ if (!db()->IsReadWrite()) {
+ LOG4CXX_ERROR(logger_, "There are no read/write permissions for database");
+ return false;
+ }
+#endif // __QNX__
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(kCreateSchema)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed creating schema of database: " << query.LastError().text());
+ return false;
+ }
+
+ return true;
+}
+
+bool AppLaunchDataDB::Persist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool retVal = false;
+
+ if (!init_successeful_) {
+ LOG4CXX_ERROR(logger_,
+ "AppLaunch data base was not successfully "
+ "initialize, AppLaunch won't work!");
+ return retVal;
+ }
+
+ if ((retVal = WriteDb())) {
+ LOG4CXX_DEBUG(logger_, "App_lauch had been successfully saved.");
+ } else {
+ LOG4CXX_WARN(logger_, "Fail to save app_launch data.");
+ }
+
+ return retVal;
+}
+
+bool AppLaunchDataDB::IsAppDataAlreadyExisted(
+ const ApplicationData& app_data) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool retVal = false;
+
+ if (!init_successeful_) {
+ LOG4CXX_ERROR(logger_,
+ "AppLaunch data base was not successfully "
+ "initialize, AppLaunch won't work!");
+ return retVal;
+ }
+
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(kFindApplicationData)) {
+ LOG4CXX_WARN(logger_,
+ "Problem with verification queries 'kFindApplicationData'");
+ return retVal;
+ }
+
+ query.Bind(device_mac_index, app_data.device_mac_);
+ query.Bind(application_id_index, app_data.mobile_app_id_);
+ query.Bind(bundle_id_index, app_data.bundle_id_);
+
+ if (query.Exec()) {
+ retVal = query.GetBoolean(result_query);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed execute query 'kGetNumberOfApplicationData'. Reson: "
+ << query.LastError().text());
+ }
+
+ return retVal;
+}
+
+bool AppLaunchDataDB::RefreshAppSessionTime(const ApplicationData& app_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool retVal = false;
+
+ if (!init_successeful_) {
+ LOG4CXX_ERROR(logger_,
+ "AppLaunch data base was not successfully "
+ "initialize, AppLaunch won't work!");
+ return retVal;
+ }
+
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(kRefreshApplicationDataSessionTime)) {
+ LOG4CXX_WARN(logger_,
+ "Problem with verification queries "
+ "'kRefreshApplicationDataSessionTime'");
+ return retVal;
+ }
+
+ query.Bind(device_mac_index, app_data.device_mac_);
+ query.Bind(application_id_index, app_data.mobile_app_id_);
+ query.Bind(bundle_id_index, app_data.bundle_id_);
+
+ if (query.Exec()) {
+ LOG4CXX_DEBUG(logger_, "Dare&time last session were updated successfully");
+ retVal = WriteDb();
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed execute query 'kGetNumberOfApplicationData'. Reson: "
+ << query.LastError().text());
+ }
+
+ return retVal;
+}
+
+bool AppLaunchDataDB::AddNewAppData(const ApplicationData& app_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool retVal = false;
+
+ if (!init_successeful_) {
+ LOG4CXX_ERROR(logger_,
+ "AppLaunch data base was not successfully "
+ "initialize, AppLaunch won't work!");
+ return retVal;
+ }
+
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(kAddApplicationData)) {
+ LOG4CXX_WARN(logger_,
+ "Problem with verification queries 'kAddApplicationData'");
+ return retVal;
+ }
+
+ query.Bind(device_mac_index, app_data.device_mac_);
+ query.Bind(application_id_index, app_data.mobile_app_id_);
+ query.Bind(bundle_id_index, app_data.bundle_id_);
+
+ retVal = query.Exec();
+ if (retVal) {
+ LOG4CXX_DEBUG(logger_, "New application data was added successfully");
+ retVal = WriteDb();
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed execute query 'kGetNumberOfApplicationData'. Reson: "
+ << query.LastError().text());
+ }
+
+ return retVal;
+}
+
+std::vector<ApplicationDataPtr> AppLaunchDataDB::GetAppDataByDevMac(
+ const std::string& dev_mac) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<ApplicationDataPtr> dev_apps;
+
+ if (!init_successeful_) {
+ LOG4CXX_ERROR(logger_,
+ "AppLaunch data base was not successfully "
+ "initialize, AppLaunch won't work!");
+ return dev_apps;
+ }
+
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(kGetApplicationDataByDevID)) {
+ LOG4CXX_WARN(
+ logger_,
+ "Problem with verification queries 'kGetApplicationDataByDevID'");
+ return dev_apps;
+ }
+
+ query.Bind(device_mac_index, dev_mac);
+ const bool retVal = query.Exec();
+ if (retVal) {
+ LOG4CXX_INFO(logger_,
+ "Values of ignition off counts were updated successfully");
+ do {
+ const std::string device_mac = query.GetString(device_mac_index);
+ const std::string mobile_app_id = query.GetString(application_id_index);
+ const std::string bundle_id = query.GetString(bundle_id_index);
+ dev_apps.push_back(utils::MakeShared<ApplicationData>(
+ mobile_app_id, bundle_id, device_mac));
+ } while (query.Next());
+ LOG4CXX_DEBUG(logger_, "All application data has been successfully loaded");
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed execute query 'kGetNumberOfApplicationData'. Reson: "
+ << query.LastError().text());
+ }
+
+ return dev_apps;
+}
+
+bool AppLaunchDataDB::Clear() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool retVal = false;
+
+ utils::dbms::SQLQuery query(db());
+ retVal = query.Exec(kDropSchema);
+
+ if (retVal) {
+ LOG4CXX_INFO(logger_, "App_Launch table had been cleared successfully");
+ retVal = WriteDb();
+ init_successeful_ = false;
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed dropping database: " << query.LastError().text());
+ }
+
+ return retVal;
+}
+
+uint32_t AppLaunchDataDB::GetCurentNumberOfAppData() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t number_of_app_data = 0u;
+
+ if (!init_successeful_) {
+ LOG4CXX_ERROR(logger_,
+ "AppLaunch data base was not successfully "
+ "initialize, AppLaunch won't work!");
+ return number_of_app_data;
+ }
+
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(kGetNumberOfApplicationData)) {
+ LOG4CXX_WARN(
+ logger_,
+ "Problem with verification queries 'kGetNumberOfApplicationData'");
+ return number_of_app_data;
+ }
+
+ if (query.Exec()) {
+ LOG4CXX_INFO(logger_,
+ "Values of ignition off counts were updated successfully");
+
+ number_of_app_data = query.GetInteger(result_query);
+ LOG4CXX_DEBUG(logger_,
+ "Total cout saved mobile applications is "
+ << number_of_app_data);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed execute query 'kGetNumberOfApplicationData'. Reson: "
+ << query.LastError().text());
+ }
+
+ return number_of_app_data;
+}
+
+bool AppLaunchDataDB::DeleteOldestAppData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool retVal = false;
+
+ if (!init_successeful_) {
+ LOG4CXX_ERROR(logger_,
+ "AppLaunch data base was not successfully "
+ "initialize, AppLaunch won't work!");
+ return retVal;
+ }
+
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(kDeleteOldestAppData)) {
+ LOG4CXX_WARN(logger_,
+ "Problem with verification queries 'kDeleteOldestAppData'");
+ return retVal;
+ }
+
+ if ((retVal = query.Exec())) {
+ LOG4CXX_INFO(logger_,
+ "Values of ignition off counts were updated successfully");
+ retVal = WriteDb();
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed execute query 'kGetNumberOfApplicationData'. Reson: "
+ << query.LastError().text());
+ }
+
+ return retVal;
+}
+
+bool AppLaunchDataDB::WriteDb() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return db_->Backup();
+}
+
+utils::dbms::SQLDatabase* AppLaunchDataDB::db() const {
+#ifdef __QNX__
+ std::auto_ptr<utils::dbms::SQLDatabase> db_qnx(
+ new utils::dbms::SQLDatabase(kDatabaseName));
+ db_qnx.get()->Open();
+ return db_qnx.get();
+#else
+ return db_.get();
+#endif // __QNX__
+}
+
+} // namespace resumption
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_impl.cc b/src/components/application_manager/src/app_launch/app_launch_data_impl.cc
new file mode 100644
index 0000000000..c095cc9d94
--- /dev/null
+++ b/src/components/application_manager/src/app_launch/app_launch_data_impl.cc
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/app_launch/app_launch_data_impl.h"
+#include "utils/logger.h"
+
+namespace app_launch {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
+
+AppLaunchDataImpl::AppLaunchDataImpl(const AppLaunchSettings& settings)
+ : settings_(settings)
+ , kMaxNumberOfiOSdevice(settings.max_number_of_ios_device()) {}
+
+AppLaunchDataImpl::~AppLaunchDataImpl() {}
+
+bool AppLaunchDataImpl::AddApplicationData(const ApplicationData& app_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool retVal = true;
+
+ if (app_data.device_mac_.empty() == false &&
+ app_data.mobile_app_id_.empty() == false &&
+ app_data.bundle_id_.empty() == false) {
+ if (IsAppDataAlreadyExisted(app_data)) {
+ LOG4CXX_INFO(logger_, "This application data already existed");
+ retVal &= RefreshAppSessionTime(app_data);
+ } else {
+ if (GetCurentNumberOfAppData() >= get_max_number_iOS_devs()) {
+ LOG4CXX_INFO(logger_,
+ "Max number of application data have. It will be deleted "
+ "the oldest one");
+ retVal &= DeleteOldestAppData();
+ }
+ retVal &= AddNewAppData(app_data);
+ LOG4CXX_INFO(logger_, "Added new application data to DB");
+ }
+ } else {
+ retVal = false;
+ }
+ return retVal;
+}
+
+std::vector<ApplicationDataPtr> AppLaunchDataImpl::GetApplicationDataByDevice(
+ const std::string& dev_mac) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<ApplicationDataPtr> apps = GetAppDataByDevMac(dev_mac);
+
+ if (apps.empty()) {
+ LOG4CXX_DEBUG(logger_, "No application founded by mac" << dev_mac);
+ }
+
+ return apps;
+}
+
+} // namespace app_launch
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
new file mode 100644
index 0000000000..7599dcccb3
--- /dev/null
+++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
@@ -0,0 +1,282 @@
+/*
+ * 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 <algorithm>
+#include "application_manager/app_launch/app_launch_data_json.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/make_shared.h"
+#include "utils/date_time.h"
+#include "json/json.h"
+
+namespace app_launch {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
+
+AppLaunchDataJson::AppLaunchDataJson(const AppLaunchSettings& settings,
+ resumption::LastState& last_state)
+ : AppLaunchDataImpl(settings)
+ , app_launch_json_lock_(true)
+ , last_state_(last_state) {}
+
+AppLaunchDataJson::~AppLaunchDataJson() {}
+
+Json::Value& AppLaunchDataJson::GetSavedApplicationDataList() const {
+ using namespace application_manager;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(app_launch_json_lock_);
+ Json::Value& app_launch = GetApplicationData();
+ if (!app_launch.isMember(strings::app_launch_list)) {
+ app_launch[strings::app_launch_list] = Json::Value(Json::arrayValue);
+ LOG4CXX_WARN(logger_, "app_list section is missed");
+ }
+ Json::Value& app_launch_list = app_launch[strings::app_launch_list];
+ if (!app_launch_list.isArray()) {
+ LOG4CXX_ERROR(logger_, "app_launch_list type INVALID rewrite");
+ app_launch_list = Json::Value(Json::arrayValue);
+ }
+ return app_launch_list;
+}
+
+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().get_dictionary();
+ if (!dictionary.isMember(strings::app_launch)) {
+ dictionary[strings::app_launch] = Json::Value(Json::objectValue);
+ LOG4CXX_WARN(logger_, "app_launch section is missed");
+ }
+ Json::Value& app_launch = dictionary[strings::app_launch];
+ if (!app_launch.isObject()) {
+ LOG4CXX_ERROR(logger_, "resumption type INVALID rewrite");
+ app_launch = Json::Value(Json::objectValue);
+ }
+ return app_launch;
+}
+
+Json::Value& AppLaunchDataJson::GetApplicationListAndIndex(
+ const ApplicationData& app_data, int32_t& founded_index) const {
+ using namespace application_manager;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(app_launch_json_lock_);
+
+ Json::Value& apps_list = GetSavedApplicationDataList();
+ const Json::ArrayIndex size = apps_list.size();
+
+ for (Json::ArrayIndex idx = 0; idx != size; ++idx) {
+ if (apps_list[idx].isMember(strings::device_id) &&
+ apps_list[idx].isMember(strings::bundle_id) &&
+ apps_list[idx].isMember(strings::app_id) &&
+ apps_list[idx].isMember(strings::app_launch_last_session)) {
+ const std::string deviceID =
+ apps_list[idx][strings::device_id].asString();
+ const std::string bundleID =
+ apps_list[idx][strings::bundle_id].asString();
+ const std::string appID = apps_list[idx][strings::app_id].asString();
+
+ if (deviceID == app_data.device_mac_ && bundleID == app_data.bundle_id_ &&
+ appID == app_data.mobile_app_id_) {
+ founded_index = idx;
+ }
+ }
+ }
+
+ return apps_list;
+}
+
+bool AppLaunchDataJson::IsAppDataAlreadyExisted(
+ const ApplicationData& app_data) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ int32_t index = NotFound;
+ GetApplicationListAndIndex(app_data, index);
+ return index == NotFound ? false : true;
+}
+
+bool AppLaunchDataJson::RefreshAppSessionTime(const ApplicationData& app_data) {
+ using namespace application_manager;
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool retVal = false;
+
+ int32_t index = NotFound;
+ Json::Value& json_data_list = GetApplicationListAndIndex(app_data, index);
+ if (index != NotFound) {
+ if (json_data_list.empty() == false) {
+ json_data_list[index][strings::app_launch_last_session] =
+ static_cast<Json::Value::UInt64>(DateTime::getCurrentTime().tv_sec);
+ retVal = true;
+ }
+ }
+ return retVal;
+}
+
+bool AppLaunchDataJson::AddNewAppData(const ApplicationData& app_data) {
+ using namespace application_manager;
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(app_launch_json_lock_);
+
+ Json::Value& json_app_data =
+ GetSavedApplicationDataList().append(Json::Value());
+ json_app_data[strings::device_id] = app_data.device_mac_;
+ json_app_data[strings::app_id] = app_data.mobile_app_id_;
+ json_app_data[strings::bundle_id] = app_data.bundle_id_;
+ json_app_data[strings::app_launch_last_session] =
+ static_cast<Json::Value::UInt64>(DateTime::getCurrentTime().tv_sec);
+
+ LOG4CXX_DEBUG(logger_,
+ "New application data saved. Detatils device_id: "
+ << app_data.device_mac_
+ << ", app_id: " << app_data.mobile_app_id_
+ << ", bundle_id: " << app_data.bundle_id_ << ".");
+
+ return true;
+}
+
+std::vector<ApplicationDataPtr> AppLaunchDataJson::GetAppDataByDevMac(
+ const std::string& dev_mac) const {
+ using namespace application_manager;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(app_launch_json_lock_);
+ std::vector<ApplicationDataPtr> dev_apps;
+ const Json::Value& apps_list = GetSavedApplicationDataList();
+ const Json::ArrayIndex size = apps_list.size();
+
+ for (Json::ArrayIndex idx = 0; idx != size; ++idx) {
+ if (apps_list[idx].isMember(strings::device_id) &&
+ apps_list[idx].isMember(strings::bundle_id) &&
+ apps_list[idx].isMember(strings::app_id) &&
+ apps_list[idx].isMember(strings::app_launch_last_session)) {
+ const std::string deviceMac =
+ apps_list[idx][strings::device_id].asString();
+ const std::string bundleID =
+ apps_list[idx][strings::bundle_id].asString();
+ const std::string appID = apps_list[idx][strings::app_id].asString();
+
+ if (deviceMac == dev_mac) {
+ dev_apps.push_back(
+ utils::MakeShared<ApplicationData>(appID, bundleID, deviceMac));
+ }
+ }
+ }
+
+ return dev_apps;
+}
+
+bool AppLaunchDataJson::Clear() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ GetSavedApplicationDataList().clear();
+
+ LOG4CXX_DEBUG(logger_,
+ "Application launch JSON section successfully cleared.");
+
+ return true;
+}
+
+uint32_t AppLaunchDataJson::GetCurentNumberOfAppData() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t list_size = GetSavedApplicationDataList().size();
+
+ LOG4CXX_DEBUG(logger_,
+ "Successfully was gotten app_launch list. Size: " << list_size);
+
+ return list_size;
+}
+
+bool AppLaunchDataJson::DeleteOldestAppData() {
+ using namespace application_manager;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(app_launch_json_lock_);
+ std::vector<uint64_t> temp_array;
+ std::vector<Json::Value> temp_json_list;
+ Json::Value& apps_list = GetSavedApplicationDataList();
+ const Json::ArrayIndex size = apps_list.size();
+
+ // Search oldest record in Json
+ // for it collect all timestaps in vector
+ for (Json::ArrayIndex idx = 0; idx != size; ++idx) {
+ if (apps_list[idx].isMember(strings::device_id) &&
+ apps_list[idx].isMember(strings::bundle_id) &&
+ apps_list[idx].isMember(strings::app_id) &&
+ apps_list[idx].isMember(strings::app_launch_last_session)) {
+ temp_array.push_back(
+ apps_list[idx][strings::app_launch_last_session].asUInt64());
+ }
+ }
+
+ // Calc oldest one and found index of it in Json
+ const int32_t oldest_index =
+ (std::min_element(temp_array.begin(), temp_array.end()) -
+ temp_array.begin());
+
+ // Copy in temporary vector Json list without oldest record
+ int32_t i = 0;
+ for (Json::Value::iterator it = GetSavedApplicationDataList().begin();
+ it != GetSavedApplicationDataList().end();
+ ++it, i++) {
+ if ((*it).isMember(strings::device_id) &&
+ (*it).isMember(strings::bundle_id) && (*it).isMember(strings::app_id) &&
+ (*it).isMember(strings::app_launch_last_session)) {
+ if (i == oldest_index) {
+ continue;
+ }
+ temp_json_list.push_back((*it));
+ }
+ }
+
+ // Clear Json list
+ GetSavedApplicationDataList().clear();
+
+ // Copy to Json new list without oldest one
+ for (std::vector<Json::Value>::iterator it = temp_json_list.begin();
+ it != temp_json_list.end();
+ ++it) {
+ GetSavedApplicationDataList().append((*it));
+ }
+
+ LOG4CXX_DEBUG(
+ logger_, "Oldest application launch data had been successfully deleted.");
+
+ return true;
+}
+
+bool AppLaunchDataJson::Persist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(app_launch_json_lock_);
+ last_state().SaveStateToFileSystem();
+ return true;
+}
+
+} // app_launch
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
new file mode 100644
index 0000000000..950bcd44fa
--- /dev/null
+++ b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/app_launch/app_launch_sql_queries.h"
+
+namespace app_launch {
+
+const std::string kCreateSchema =
+ "CREATE TABLE IF NOT EXISTS `app_launch`( "
+ " `deviceMac` TEXT, "
+ " `appID` TEXT,"
+ " `bundleID` TEXT,"
+ " `last_session` DATETIME, "
+ " PRIMARY KEY(`deviceMac`, `appID`, `bundleID`)"
+ " ); ";
+
+const std::string kDropSchema = "DROP TABLE IF EXISTS `app_launch`; ";
+
+const std::string kAddApplicationData =
+ "INSERT INTO `app_launch`"
+ "(`deviceMac`, `appID`, `bundleID`, `last_session`)"
+ "VALUES "
+ "(?, ?, ?, STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'));";
+
+const std::string kFindApplicationData =
+ " SELECT COUNT(*)"
+ "FROM `app_launch`"
+ "WHERE `deviceMac` = ? AND `appID` = ? AND `bundleID` = ?;";
+
+const std::string kDeleteOldestAppData =
+ "DELETE FROM `app_launch`"
+ "WHERE `last_session` IN ("
+ "SELECT MIN(`last_session`)"
+ "FROM `app_launch`);";
+
+const std::string kGetNumberOfApplicationData =
+ "SELECT COUNT (*)"
+ "FROM `app_launch` ;";
+
+const std::string kGetApplicationDataByDevID =
+ "SELECT *"
+ "FROM `app_launch`"
+ "WHERE `deviceMac` = ?;";
+
+const std::string kRefreshApplicationDataSessionTime =
+ "UPDATE `app_launch`"
+ "SET `last_session` = STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')"
+ "WHERE `deviceMac` = ? AND appID = ? AND bundleID = ?;";
+
+} // namespace resumption
diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc
new file mode 100644
index 0000000000..41465ae985
--- /dev/null
+++ b/src/components/application_manager/src/app_launch/apps_launcher.cc
@@ -0,0 +1,139 @@
+#include <algorithm>
+#include "application_manager/app_launch/apps_launcher.h"
+#include "utils/make_shared.h"
+#include "utils/timer_task_impl.h"
+#include <iostream>
+
+namespace app_launch {
+struct LauncherGenerator {
+ LauncherGenerator(AppsLauncher& apps_laucnher,
+ connection_handler::ConnectionHandler& connection_handler,
+ const uint16_t app_launch_max_retry_attempt,
+ const uint16_t app_launch_retry_wait_time)
+ : apps_laucnher_(apps_laucnher)
+ , connection_handler_(connection_handler)
+ , app_launch_max_retry_attempt_(app_launch_max_retry_attempt)
+ , app_launch_retry_wait_time_(app_launch_retry_wait_time) {}
+ AppsLauncher::LauncherPtr operator()() {
+ return utils::MakeShared<AppsLauncher::Launcher>(
+ apps_laucnher_,
+ connection_handler_,
+ app_launch_max_retry_attempt_,
+ app_launch_retry_wait_time_);
+ }
+
+ AppsLauncher& apps_laucnher_;
+ connection_handler::ConnectionHandler& connection_handler_;
+ const uint16_t app_launch_max_retry_attempt_;
+ const uint16_t app_launch_retry_wait_time_;
+};
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
+AppsLauncher::AppsLauncher(
+ connection_handler::ConnectionHandler& connection_handler,
+ const uint16_t max_number_of_ios_device,
+ const uint16_t app_launch_max_retry_attempt,
+ const uint16_t app_launch_retry_wait_time) {
+ sync_primitives::AutoLock lock(launchers_lock_);
+ free_launchers_.resize(max_number_of_ios_device);
+ std::generate(free_launchers_.begin(),
+ free_launchers_.end(),
+ LauncherGenerator(*this,
+ connection_handler,
+ app_launch_max_retry_attempt,
+ app_launch_retry_wait_time));
+}
+
+void AppsLauncher::StartLaunching(ApplicationDataPtr app_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ DCHECK_OR_RETURN_VOID(!free_launchers_.empty())
+ const AppLaunchers::iterator it = free_launchers_.begin();
+ LauncherPtr app_launcher = *it;
+ works_launchers_.push_back(app_launcher);
+ free_launchers_.erase(it);
+ app_launcher->PosponedLaunch(app_data);
+}
+
+struct AppLauncherFinder {
+ AppLauncherFinder(const ApplicationDataPtr& app_data) : app_data_(app_data) {}
+ bool operator()(const AppsLauncher::LauncherPtr& launcher) const {
+ DCHECK_OR_RETURN(launcher->app_data_ && app_data_, false)
+ return *launcher->app_data_ == *app_data_;
+ }
+ const ApplicationDataPtr& app_data_;
+};
+
+void AppsLauncher::StopLaunching(ApplicationDataPtr app_data) {
+ sync_primitives::AutoLock lock(launchers_lock_);
+ const AppLaunchers::iterator it = std::find_if(works_launchers_.begin(),
+ works_launchers_.end(),
+ AppLauncherFinder(app_data));
+ if (it != works_launchers_.end()) {
+ LauncherPtr launcher = *it;
+ launcher->Clear();
+ free_launchers_.push_back(launcher);
+ works_launchers_.erase(it);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Unable to StopLaunching" << app_data->mobile_app_id_);
+ }
+}
+
+void AppsLauncher::OnLaunched(ApplicationDataPtr app_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ StopLaunching(app_data);
+}
+
+void AppsLauncher::OnRetryAttemptsExhausted(ApplicationDataPtr app_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ StopLaunching(app_data);
+}
+
+AppsLauncher::Launcher::Launcher(
+ AppsLauncher& parent,
+ connection_handler::ConnectionHandler& connection_handler,
+ const uint16_t app_launch_max_retry_attempt,
+ const uint16_t app_launch_retry_wait_time)
+ : retry_timer_(
+ "AppsLauncherTimer",
+ new timer::TimerTaskImpl<Launcher>(this, &Launcher::LaunchNow))
+ , app_launch_max_retry_attempt_(app_launch_max_retry_attempt)
+ , app_launch_retry_wait_time_(app_launch_retry_wait_time)
+ , connection_handler_(connection_handler)
+ , parent_(parent) {}
+
+void AppsLauncher::Launcher::PosponedLaunch(
+ const app_launch::ApplicationDataPtr& app_data) {
+ DCHECK(!app_data_);
+ app_data_ = app_data;
+ retry_index_ = 0;
+ retry_timer_.Start(app_launch_retry_wait_time_, timer::kPeriodic);
+ LOG4CXX_DEBUG(logger_,
+ "Applicaiton " << app_data->mobile_app_id_ << " on device "
+ << app_data->device_mac_
+ << " will be launched in "
+ << app_launch_retry_wait_time_ << " ms");
+}
+
+void AppsLauncher::Launcher::Clear() {
+ retry_timer_.Stop();
+ app_data_.reset();
+ retry_index_ = 0;
+}
+
+void AppsLauncher::Launcher::LaunchNow() {
+ if (retry_index_++ < app_launch_max_retry_attempt_) {
+ LOG4CXX_DEBUG(logger_,
+ "Run App " << app_data_->mobile_app_id_ << "with bundle "
+ << app_data_->bundle_id_ << " On Device "
+ << app_data_->device_mac_);
+
+ connection_handler_.RunAppOnDevice(app_data_->device_mac_,
+ app_data_->bundle_id_);
+ } else {
+ parent_.OnRetryAttemptsExhausted(app_data_);
+ }
+}
+
+} // namespace app_launch
diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
new file mode 100644
index 0000000000..0eb9245cf8
--- /dev/null
+++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
@@ -0,0 +1,208 @@
+#include <string>
+#include <vector>
+#include <algorithm>
+
+#include "application_manager/app_launch/device_apps_launcher.h"
+#include "application_manager/app_launch/app_launch_data.h"
+#include "application_manager/app_launch/apps_launcher.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "utils/timer.h"
+#include "utils/timer_task_impl.h"
+#include <iostream>
+
+namespace app_launch {
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
+
+typedef std::pair<std::string, std::vector<ApplicationDataPtr> > AppsOnDevice;
+typedef utils::SharedPtr<AppsOnDevice> AppsOnDevicePtr;
+
+class Launcher {
+ public:
+ Launcher(const resumption::ResumeCtrl& resume_ctrl,
+ DeviceAppsLauncher& device_launcher,
+ AppsLauncher& apps_launcher)
+ : device_launcher_(device_launcher)
+ , apps_launcher_(apps_launcher)
+ , resume_ctrl_(resume_ctrl)
+ , gap_between_app_timer_("GapBetweenLaunchTimer",
+ new timer::TimerTaskImpl<Launcher>(
+ this, &Launcher::OnGapBetweenLaunchExpired))
+ , wait_before_launch_timer_(
+ "WaitBeforeLainchTimer",
+ new timer::TimerTaskImpl<Launcher>(this, &Launcher::LaunchNext)) {}
+
+ void Start(const AppsOnDevicePtr& apps_on_device) {
+ DCHECK(!apps_on_device_);
+ apps_on_device_ = apps_on_device;
+ const time_t curr_time = time(NULL);
+ const time_t sdl_launch_time = resume_ctrl_.LaunchTime();
+ const double seconds_from_sdl_start = difftime(curr_time, sdl_launch_time);
+ const uint32_t wait_time =
+ device_launcher_.settings().resumption_delay_after_ign();
+ const uint32_t wait_before_launch_timeout =
+ seconds_from_sdl_start < wait_time
+ ? wait_time - seconds_from_sdl_start
+ : device_launcher_.settings().app_launch_wait_time();
+ wait_before_launch_timer_.Start(wait_before_launch_timeout,
+ timer::kSingleShot);
+ }
+
+ void LaunchNext() {
+ std::vector<ApplicationDataPtr>& apps = apps_on_device_->second;
+ std::vector<ApplicationDataPtr>::iterator it = apps.begin();
+ if (it != apps.end()) {
+ apps_launcher_.StartLaunching(*it);
+ apps.erase(it);
+ gap_between_app_timer_.Start(
+ device_launcher_.settings().wait_time_between_apps(),
+ timer::kSingleShot);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "All Apps on " << apps_on_device_->first
+ << " posponed launched");
+ device_launcher_.StopLaunchingAppsOnDevice(apps_on_device_->first);
+ }
+ }
+
+ void OnGapBetweenLaunchExpired() {
+ LaunchNext();
+ }
+
+ void OnAppRegistered(const ApplicationDataPtr& app_data) {
+ std::vector<ApplicationDataPtr>& apps = apps_on_device_->second;
+ std::vector<ApplicationDataPtr>::iterator it =
+ std::find(apps.begin(), apps.end(), app_data);
+ if (it != apps.end()) {
+ apps.erase(it);
+ }
+ }
+
+ void Clear() {
+ gap_between_app_timer_.Stop();
+ wait_before_launch_timer_.Stop();
+ apps_on_device_.reset();
+ }
+
+ DeviceAppsLauncher& device_launcher_;
+ AppsLauncher& apps_launcher_;
+ const resumption::ResumeCtrl& resume_ctrl_;
+
+ timer::Timer gap_between_app_timer_;
+ timer::Timer wait_before_launch_timer_;
+
+ AppsOnDevicePtr apps_on_device_;
+};
+
+typedef utils::SharedPtr<Launcher> LauncherPtr;
+typedef std::vector<LauncherPtr> Launchers;
+
+struct LauncherGenerator {
+ LauncherGenerator(resumption::ResumeCtrl& resume_ctrl,
+ DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher)
+ : resume_ctrl_(resume_ctrl)
+ , interface_(interface)
+ , apps_launcher_(apps_launcher) {}
+
+ LauncherPtr operator()() const {
+ return utils::MakeShared<Launcher>(
+ resume_ctrl_, interface_, apps_launcher_);
+ }
+
+ resumption::ResumeCtrl& resume_ctrl_;
+ DeviceAppsLauncher& interface_;
+ AppsLauncher& apps_launcher_;
+};
+
+class DeviceAppsLauncherImpl {
+ public:
+ DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher)
+ : interface_(interface) {
+ sync_primitives::AutoLock lock(launchers_lock_);
+ LauncherGenerator generate(
+ interface.app_mngr_.resume_controller(), interface, apps_launcher);
+ free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
+ std::generate_n(std::back_inserter(free_launchers_),
+ interface.settings_.max_number_of_ios_device(),
+ generate);
+ }
+
+ bool LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "On Device " << device_mac << " will be launched "
+ << applications_to_launch.size() << " apps");
+ AppsOnDevicePtr apps_on_device =
+ utils::MakeShared<AppsOnDevice>(device_mac, applications_to_launch);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ DCHECK_OR_RETURN(!free_launchers_.empty(), false)
+ const Launchers::iterator it = free_launchers_.begin();
+ LauncherPtr launcher = *it;
+ works_launchers_.push_back(launcher);
+ free_launchers_.erase(it);
+ launcher->Start(apps_on_device);
+ return true;
+ }
+
+ struct LauncherFinder {
+ LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+
+ bool operator()(const LauncherPtr& launcher) const {
+ return device_mac_ == launcher->apps_on_device_->first;
+ }
+
+ std::string device_mac_;
+ };
+
+ bool StopLaunchingAppsOnDevice(const std::string& device_mac) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ const Launchers::iterator it = std::find_if(works_launchers_.begin(),
+ works_launchers_.end(),
+ LauncherFinder(device_mac));
+ if (it == works_launchers_.end()) {
+ return false;
+ }
+ LauncherPtr launcher = *it;
+ launcher->Clear();
+ free_launchers_.push_back(launcher);
+ works_launchers_.erase(it);
+ return true;
+ }
+
+ private:
+ sync_primitives::Lock launchers_lock_;
+ Launchers free_launchers_;
+ Launchers works_launchers_;
+ DeviceAppsLauncher& interface_;
+};
+
+bool DeviceAppsLauncher::LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch) {
+ return impl_->LaunchAppsOnDevice(device_mac, applications_to_launch);
+}
+
+DeviceAppsLauncher::DeviceAppsLauncher(
+ application_manager::ApplicationManager& app_mngr,
+ app_launch::AppsLauncher& apps_launcher,
+ const AppLaunchSettings& settings)
+ : app_mngr_(app_mngr)
+ , settings_(settings)
+ , impl_(new DeviceAppsLauncherImpl(*this, apps_launcher)) {}
+
+bool DeviceAppsLauncher::StopLaunchingAppsOnDevice(
+ const std::string& device_mac) {
+ return impl_->StopLaunchingAppsOnDevice(device_mac);
+}
+
+const AppLaunchSettings& DeviceAppsLauncher::settings() const {
+ return settings_;
+}
+
+} // namespace app_launch
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 61451e3602..5f9c4386f5 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -171,6 +171,11 @@ 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;
@@ -318,6 +323,10 @@ const std::string& ApplicationImpl::app_icon_path() const {
return app_icon_path_;
}
+const std::string& ApplicationImpl::bundle_id() const {
+ return bundle_id_;
+}
+
connection_handler::DeviceHandle ApplicationImpl::device() const {
return device_;
}
@@ -489,7 +498,8 @@ void ApplicationImpl::WakeUpStreaming(
ServiceType::kMobileNav, true, application_manager_);
video_streaming_suspended_ = false;
}
- video_stream_suspend_timer_.Start(video_stream_suspend_timeout_, false);
+ video_stream_suspend_timer_.Start(video_stream_suspend_timeout_,
+ timer::kPeriodic);
} else if (ServiceType::kAudio == service_type) {
sync_primitives::AutoLock lock(audio_streaming_suspended_lock_);
if (audio_streaming_suspended_) {
@@ -498,7 +508,8 @@ void ApplicationImpl::WakeUpStreaming(
ServiceType::kAudio, true, application_manager_);
audio_streaming_suspended_ = false;
}
- audio_stream_suspend_timer_.Start(audio_stream_suspend_timeout_, false);
+ audio_stream_suspend_timer_.Start(audio_stream_suspend_timeout_,
+ timer::kPeriodic);
}
}
@@ -570,6 +581,10 @@ void ApplicationImpl::set_grammar_id(uint32_t value) {
grammar_id_ = value;
}
+void ApplicationImpl::set_bundle_id(const std::string& bundle_id) {
+ bundle_id_ = bundle_id;
+}
+
void ApplicationImpl::ResetDataInNone() {
put_file_in_none_count_ = 0;
delete_file_in_none_count_ = 0;
@@ -688,7 +703,7 @@ UsageStatistics& ApplicationImpl::usage_report() {
return usage_report_;
}
-bool ApplicationImpl::IsCommandLimitsExceeded(
+bool ApplicationImpl::AreCommandLimitsExceeded(
mobile_apis::FunctionID::eType cmd_id, TLimitSource source) {
TimevalStruct current = date_time::DateTime::getCurrentTime();
switch (source) {
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 8cf09412f3..097abc4645 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -44,6 +44,11 @@
#include "application_manager/message_helper.h"
#include "application_manager/mobile_message_handler.h"
#include "application_manager/policies/policy_handler.h"
+#include "application_manager/hmi_capabilities_impl.h"
+#include "application_manager/resumption/resume_ctrl_impl.h"
+#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 "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_handler.h"
#include "connection_handler/connection_handler_impl.h"
@@ -104,7 +109,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
, 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)
@@ -114,10 +119,10 @@ ApplicationManagerImpl::ApplicationManagerImpl(
, messages_from_hmi_("AM FromHMI", this)
, messages_to_hmi_("AM ToHMI", this)
, audio_pass_thru_messages_("AudioPassThru", this)
- , hmi_capabilities_(*this)
+ , hmi_capabilities_(new HMICapabilitiesImpl(*this))
, unregister_reason_(
mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM)
- , resume_ctrl_(*this)
+ , resume_ctrl_(new resumption::ResumeCtrlImpl(*this))
, navi_close_app_timeout_(am_settings.stop_streaming_timeout())
, navi_end_stream_timeout_(am_settings.stop_streaming_timeout())
, stopping_application_mng_lock_(true)
@@ -134,6 +139,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);
@@ -148,7 +154,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::ClearTimerPool)));
const uint32_t timeout_ms = 10000u;
- clearing_timer->Start(timeout_ms, false);
+ clearing_timer->Start(timeout_ms, timer::kSingleShot);
timer_pool_.push_back(clearing_timer);
}
@@ -427,7 +433,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
LOG4CXX_DEBUG(logger_, "Restarting application list update timer");
GetPolicyHandler().OnAppsSearchStarted();
uint32_t timeout = get_settings().application_list_update_timeout();
- application_list_update_timer_.Start(timeout, true);
+ application_list_update_timer_.Start(timeout, timer::kSingleShot);
if (!is_all_apps_allowed_) {
LOG4CXX_WARN(logger_,
@@ -462,12 +468,6 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
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,
@@ -534,26 +534,32 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
if (!application->hmi_app_id()) {
const bool is_saved =
- resume_ctrl_.IsApplicationSaved(policy_app_id, device_mac);
+ resume_controller().IsApplicationSaved(policy_app_id, device_mac);
application->set_hmi_application_id(
- is_saved ? resume_ctrl_.GetHMIApplicationID(policy_app_id, device_mac)
- : GenerateNewHMIAppID());
+ is_saved
+ ? resume_controller().GetHMIApplicationID(policy_app_id, device_mac)
+ : GenerateNewHMIAppID());
}
+ if (params.keyExists(strings::app_info)) {
+ const smart_objects::SmartObject& app_info = params[strings::app_info];
+ const std::string& bundle_id = app_info[strings::bundle_id].asString();
+ application->set_bundle_id(bundle_id);
+ }
// 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.
- resume_ctrl_.OnAppRegistrationStart(policy_app_id, device_mac);
+ resume_controller().OnAppRegistrationStart(policy_app_id, device_mac);
+
// Add application to registered app list and set appropriate mark.
// Lock has to be released before adding app to policy DB to avoid possible
// deadlock with simultaneous PTU processing
applications_list_lock_.Acquire();
application->MarkRegistered();
applications_.insert(application);
+ apps_size_ = applications_.size();
applications_list_lock_.Release();
- GetPolicyHandler().AddApplication(application->policy_app_id());
-
return application;
}
@@ -913,6 +919,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated(
GetPolicyHandler().AddDevice(dev_params.device_mac_address,
device_info.connection_type);
+ app_launch_ctrl().OnDeviceConnected(dev_params.device_mac_address);
}
smart_objects::SmartObjectSPtr msg_params =
@@ -939,7 +946,7 @@ void ApplicationManagerImpl::OnFindNewApplicationsRequest() {
connection_handler().ConnectToAllDevices();
LOG4CXX_DEBUG(logger_, "Starting application list update timer");
uint32_t timeout = get_settings().application_list_update_timeout();
- application_list_update_timer_.Start(timeout, true);
+ application_list_update_timer_.Start(timeout, timer::kSingleShot);
GetPolicyHandler().OnAppsSearchStarted();
}
@@ -975,10 +982,10 @@ mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel(
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) {
@@ -1009,7 +1016,7 @@ uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
uint32_t hmi_app_id = get_rand_from_range(1);
LOG4CXX_DEBUG(logger_, "GenerateNewHMIAppID value is: " << hmi_app_id);
- while (resume_ctrl_.IsHMIApplicationIdExist(hmi_app_id)) {
+ while (resume_controller().IsHMIApplicationIdExist(hmi_app_id)) {
LOG4CXX_DEBUG(logger_, "HMI appID " << hmi_app_id << " is exists.");
hmi_app_id = get_rand_from_range(1);
LOG4CXX_DEBUG(logger_, "Trying new value: " << hmi_app_id);
@@ -1340,9 +1347,12 @@ 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] =
@@ -1356,6 +1366,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_,
@@ -1374,8 +1390,9 @@ void ApplicationManagerImpl::SendMessageToMobile(
// checked against policy permissions
if (msg_to_mobile[strings::params].keyExists(strings::correlation_id)) {
request_ctrl_.OnMobileResponse(
- msg_to_mobile[strings::params][strings::correlation_id].asInt(),
- msg_to_mobile[strings::params][strings::connection_key].asInt());
+ msg_to_mobile[strings::params][strings::correlation_id].asUInt(),
+ msg_to_mobile[strings::params][strings::connection_key].asUInt(),
+ msg_to_mobile[strings::params][strings::function_id].asInt());
} else if (app) {
mobile_apis::FunctionID::eType function_id =
static_cast<mobile_apis::FunctionID::eType>(
@@ -1390,21 +1407,22 @@ 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>(
@@ -1414,6 +1432,7 @@ void ApplicationManagerImpl::SendMessageToMobile(
GetPolicyHandler().OnUpdateRequestSentToMobile();
}
}
+#endif // EXTERNAL_PROPRIETARY_MODE
}
if (message_to_send->binary_data()) {
@@ -1425,9 +1444,10 @@ void ApplicationManagerImpl::SendMessageToMobile(
impl::MessageToMobile(message_to_send, final_message));
}
-void ApplicationManagerImpl::TerminateRequest(uint32_t connection_key,
- uint32_t corr_id) {
- request_ctrl_.terminateRequest(corr_id, connection_key, true);
+void ApplicationManagerImpl::TerminateRequest(const uint32_t connection_key,
+ const uint32_t corr_id,
+ const int32_t function_id) {
+ request_ctrl_.TerminateRequest(corr_id, connection_key, function_id, true);
}
bool ApplicationManagerImpl::ManageMobileCommand(
@@ -1680,8 +1700,10 @@ bool ApplicationManagerImpl::ManageHMICommand(
command->Run();
if (kResponse == message_type) {
const uint32_t correlation_id =
- (*(message.get()))[strings::params][strings::correlation_id].asInt();
- request_ctrl_.OnHMIResponse(correlation_id);
+ (*(message.get()))[strings::params][strings::correlation_id].asUInt();
+ const int32_t function_id =
+ (*(message.get()))[strings::params][strings::function_id].asInt();
+ request_ctrl_.OnHMIResponse(correlation_id, function_id);
}
return true;
}
@@ -1696,11 +1718,11 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state,
!IsReadWriteAllowed(app_storage_folder, TYPE_STORAGE)) {
return false;
}
- if (!resume_ctrl_.Init(last_state)) {
+ if (!resume_controller().Init(last_state)) {
LOG4CXX_ERROR(logger_, "Problem with initialization of resume controller");
return false;
}
- hmi_capabilities_.Init(&last_state);
+ hmi_capabilities_->Init(&last_state);
if (!(file_system::IsWritingAllowed(app_storage_folder) &&
file_system::IsReadingAllowed(app_storage_folder))) {
@@ -1737,6 +1759,16 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state,
"System is configured to work without policy functionality.");
}
media_manager_ = media_manager;
+
+ if (settings_.use_db_for_resumption()) {
+ app_launch_dto_.reset(new app_launch::AppLaunchDataDB(settings_));
+ } else {
+ app_launch_dto_.reset(
+ new app_launch::AppLaunchDataJson(settings_, last_state));
+ }
+ app_launch_ctrl_.reset(new app_launch::AppLaunchCtrlImpl(
+ *app_launch_dto_.get(), *this, settings_));
+
return true;
}
@@ -2122,11 +2154,11 @@ mobile_apis::MOBILE_API& ApplicationManagerImpl::mobile_so_factory() {
}
HMICapabilities& ApplicationManagerImpl::hmi_capabilities() {
- return hmi_capabilities_;
+ return *hmi_capabilities_;
}
const HMICapabilities& ApplicationManagerImpl::hmi_capabilities() const {
- return hmi_capabilities_;
+ return *hmi_capabilities_;
}
void ApplicationManagerImpl::PullLanguagesInfo(const SmartObject& app_data,
@@ -2257,8 +2289,8 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
device_id, NULL, NULL, &device_mac, NULL);
const uint32_t hmi_app_id =
- resume_ctrl_.IsApplicationSaved(policy_app_id, device_mac)
- ? resume_ctrl_.GetHMIApplicationID(policy_app_id, device_mac)
+ resume_controller().IsApplicationSaved(policy_app_id, device_mac)
+ ? resume_controller().GetHMIApplicationID(policy_app_id, device_mac)
: GenerateNewHMIAppID();
// AppId = 0 because this is query_app(provided by hmi for download, but not
@@ -2603,12 +2635,12 @@ void ApplicationManagerImpl::UnregisterApplication(
return;
}
if (is_resuming) {
- resume_ctrl_.SaveApplication(app_to_remove);
+ resume_controller().SaveApplication(app_to_remove);
} else {
- resume_ctrl_.RemoveApplicationFromSaved(app_to_remove);
+ resume_controller().RemoveApplicationFromSaved(app_to_remove);
}
applications_.erase(app_to_remove);
- (hmi_capabilities_.get_hmi_language_handler())
+ (hmi_capabilities_->get_hmi_language_handler())
.OnUnregisterApplication(app_id);
AppV4DevicePredicate finder(handle);
ApplicationSharedPtr app = FindApp(accessor, finder);
@@ -2750,32 +2782,20 @@ void ApplicationManagerImpl::Handle(const impl::AudioData message) {
}
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;
@@ -2783,30 +2803,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) {
@@ -2972,7 +2984,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
"CloseNaviAppTimer",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::CloseNaviApp)));
- close_timer->Start(navi_close_app_timeout_, true);
+ close_timer->Start(navi_close_app_timeout_, timer::kSingleShot);
sync_primitives::AutoLock lock(timer_pool_lock_);
timer_pool_.push_back(close_timer);
@@ -3013,7 +3025,7 @@ void ApplicationManagerImpl::OnHMILevelChanged(
"AppShouldFinishStreaming",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::EndNaviStreaming)));
- end_stream_timer->Start(navi_end_stream_timeout_, true);
+ end_stream_timer->Start(navi_end_stream_timeout_, timer::kPeriodic);
sync_primitives::AutoLock lock(timer_pool_lock_);
timer_pool_.push_back(end_stream_timer);
@@ -3077,7 +3089,7 @@ 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();
@@ -3100,12 +3112,14 @@ void ApplicationManagerImpl::EndNaviStreaming() {
using namespace mobile_apis::AppInterfaceUnregisteredReason;
using namespace mobile_apis::Result;
- uint32_t app_id = navi_app_to_end_stream_.front();
- navi_app_to_end_stream_.pop_front();
+ if (!navi_app_to_end_stream_.empty()) {
+ const uint32_t app_id = navi_app_to_end_stream_.front();
+ navi_app_to_end_stream_.pop_front();
- if (navi_app_to_stop_.end() ==
- std::find(navi_app_to_stop_.begin(), navi_app_to_stop_.end(), app_id)) {
- DisallowStreaming(app_id);
+ if (navi_app_to_stop_.end() ==
+ std::find(navi_app_to_stop_.begin(), navi_app_to_stop_.end(), app_id)) {
+ DisallowStreaming(app_id);
+ }
}
}
@@ -3159,7 +3173,7 @@ bool ApplicationManagerImpl::IsApplicationForbidden(
policy::DeviceConsent ApplicationManagerImpl::GetUserConsentForDevice(
const std::string& device_id) const {
- return policy_handler_.GetUserConsentForDevice(device_id);
+ return GetPolicyHandler().GetUserConsentForDevice(device_id);
}
void ApplicationManagerImpl::OnWakeUp() {
@@ -3250,8 +3264,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() {
@@ -3299,7 +3317,7 @@ void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList(
LOG4CXX_INFO(logger_, "Start tts_global_properties_timer_");
tts_global_properties_app_list_lock_.Release();
const uint32_t timeout_ms = 1000;
- tts_global_properties_timer_.Start(timeout_ms, false);
+ tts_global_properties_timer_.Start(timeout_ms, timer::kSingleShot);
return;
}
tts_global_properties_app_list_lock_.Release();
@@ -3460,6 +3478,10 @@ event_engine::EventDispatcher& ApplicationManagerImpl::event_dispatcher() {
return event_dispatcher_;
}
+app_launch::AppLaunchCtrl& ApplicationManagerImpl::app_launch_ctrl() {
+ return *app_launch_ctrl_;
+}
+
const std::string ApplicationManagerImpl::DirectoryTypeToString(
ApplicationManagerImpl::DirectoryType type) const {
DirectoryTypeMap::const_iterator it = dir_type_to_string_map_.find(type);
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 b3b463328f..cea5412587 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.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
@@ -32,15 +32,92 @@
#include <algorithm>
#include <string>
+#include "utils/macro.h"
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
#include "smart_objects/smart_object.h"
-
namespace application_manager {
namespace commands {
+std::string MergeInfos(const ResponseInfo& first_info,
+ const std::string& first_str,
+ const ResponseInfo& second_info,
+ const std::string& second_str) {
+ if ((first_info.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (second_info.interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !second_str.empty()) {
+ return second_str;
+ }
+
+ if ((second_info.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (first_info.interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !first_str.empty()) {
+ return first_str;
+ }
+
+ return MergeInfos(first_str, second_str);
+}
+
+std::string MergeInfos(const std::string& first, const std::string& second) {
+ return first + ((!first.empty() && !second.empty()) ? ", " : "") + second;
+}
+
+std::string MergeInfos(const std::string& first,
+ const std::string& second,
+ const std::string& third) {
+ std::string result = MergeInfos(first, second);
+ return MergeInfos(result, third);
+}
+
+const std::string CreateInfoForUnsupportedResult(
+ HmiInterfaces::InterfaceID interface) {
+ switch (interface) {
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VR): {
+ return "VR is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS): {
+ return "TTS is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_UI): {
+ return "UI is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_Navigation): {
+ return "Navi is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VehicleInfo): {
+ return "VehicleInfo is not supported by system";
+ }
+ default:
+#ifdef ENABLE_LOG
+ CREATE_LOGGERPTR_LOCAL(logger, "Commands");
+ LOG4CXX_WARN(logger,
+ "Could not create info because"
+ " interface isn't valid. Interface is:"
+ << static_cast<int32_t>(interface));
+#endif // ENABLE_LOG
+ return "";
+ }
+}
+
+bool CheckResultCode(const ResponseInfo& first, const ResponseInfo& second) {
+ if (first.is_ok && second.is_unsupported_resource &&
+ second.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) {
+ 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);
+}
+
struct DisallowedParamsInserter {
DisallowedParamsInserter(smart_objects::SmartObject& response,
mobile_apis::VehicleDataResultCode::eType code)
@@ -194,6 +271,43 @@ bool CommandRequestImpl::CheckSyntax(const std::string& str,
return true;
}
+smart_objects::SmartObject CreateUnsupportedResourceResponse(
+ const hmi_apis::FunctionID::eType function_id,
+ const uint32_t hmi_correlation_id,
+ HmiInterfaces::InterfaceID interface) {
+ smart_objects::SmartObject response(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& params = response[strings::params];
+ params[strings::message_type] = MessageType::kResponse;
+ params[strings::correlation_id] = hmi_correlation_id;
+ params[strings::protocol_type] = CommandImpl::hmi_protocol_type_;
+ params[strings::protocol_version] = CommandImpl::protocol_version_;
+ params[strings::function_id] = function_id;
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ smart_objects::SmartObject& msg_params = response[strings::msg_params];
+ msg_params[strings::info] = CreateInfoForUnsupportedResult(interface);
+ return response;
+}
+
+bool CommandRequestImpl::ProcessHMIInterfacesAvailability(
+ const uint32_t hmi_correlation_id,
+ const hmi_apis::FunctionID::eType& function_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ HmiInterfaces::InterfaceID interface =
+ hmi_interfaces.GetInterfaceFromFunction(function_id);
+ DCHECK(interface != HmiInterfaces::HMI_INTERFACE_INVALID_ENUM);
+ const HmiInterfaces::InterfaceState state =
+ hmi_interfaces.GetInterfaceState(interface);
+ if (HmiInterfaces::STATE_NOT_AVAILABLE == state) {
+ event_engine::Event event(function_id);
+ event.set_smart_object(CreateUnsupportedResourceResponse(
+ function_id, hmi_correlation_id, interface));
+ event.raise(application_manager_.event_dispatcher());
+ return false;
+ }
+ return true;
+}
+
uint32_t CommandRequestImpl::SendHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject* msg_params,
@@ -202,12 +316,6 @@ uint32_t CommandRequestImpl::SendHMIRequest(
const uint32_t hmi_correlation_id =
application_manager_.GetNextHMICorrelationID();
- if (use_events) {
- LOG4CXX_DEBUG(logger_,
- "subscribe_on_event " << function_id << " "
- << hmi_correlation_id);
- subscribe_on_event(function_id, hmi_correlation_id);
- }
smart_objects::SmartObject& request = *result;
request[strings::params][strings::message_type] = MessageType::kRequest;
@@ -222,9 +330,19 @@ uint32_t CommandRequestImpl::SendHMIRequest(
request[strings::msg_params] = *msg_params;
}
- if (!application_manager_.ManageHMICommand(result)) {
- LOG4CXX_ERROR(logger_, "Unable to send request");
- SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
+ if (use_events) {
+ LOG4CXX_DEBUG(logger_,
+ "subscribe_on_event " << function_id << " "
+ << hmi_correlation_id);
+ subscribe_on_event(function_id, hmi_correlation_id);
+ }
+ if (ProcessHMIInterfacesAvailability(hmi_correlation_id, function_id)) {
+ if (!application_manager_.ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
+ }
+ } else {
+ LOG4CXX_DEBUG(logger_, "Interface is not available");
}
return hmi_correlation_id;
}
@@ -375,60 +493,60 @@ 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;
}
@@ -438,33 +556,32 @@ void CommandRequestImpl::RemoveDisallowedParameters() {
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);
}
}
@@ -482,7 +599,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.");
@@ -504,7 +621,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));
@@ -548,6 +665,111 @@ bool CommandRequestImpl::HasDisallowedParams() const {
(!removed_parameters_permissions_.undefined_params.empty()));
}
+bool CommandRequestImpl::PrepareResultForMobileResponse(
+ hmi_apis::Common_Result::eType result_code,
+ HmiInterfaces::InterfaceID interface) const {
+ using namespace helpers;
+ if (Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ result_code,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED)) {
+ return true;
+ }
+
+ const HmiInterfaces::InterfaceState state =
+ application_manager_.hmi_interfaces().GetInterfaceState(interface);
+ if ((hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code) &&
+ (HmiInterfaces::STATE_NOT_AVAILABLE != state)) {
+ return true;
+ }
+ return false;
+}
+
+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);
+ return result;
+}
+
+void CommandRequestImpl::GetInfo(
+ const smart_objects::SmartObject& response_from_hmi,
+ std::string& out_info) {
+ if (response_from_hmi[strings::msg_params].keyExists(strings::info)) {
+ if (!response_from_hmi[strings::msg_params][strings::info].empty()) {
+ out_info =
+ response_from_hmi[strings::msg_params][strings::info].asString();
+ }
+ }
+}
+
+mobile_apis::Result::eType CommandRequestImpl::PrepareResultCodeForResponse(
+ const ResponseInfo& first, const ResponseInfo& second) {
+ 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));
+ }
+ return result_code;
+}
+
const CommandParametersPermissions& CommandRequestImpl::parameters_permissions()
const {
return parameters_permissions_;
diff --git a/src/components/application_manager/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/src/commands/hmi/close_popup_request.cc
index b0ab48dd96..d628475438 100644
--- a/src/components/application_manager/src/commands/hmi/close_popup_request.cc
+++ b/src/components/application_manager/src/commands/hmi/close_popup_request.cc
@@ -44,7 +44,6 @@ ClosePopupRequest::~ClosePopupRequest() {}
void ClosePopupRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
SendRequest();
}
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..a2e1878fac 100644
--- a/src/components/application_manager/src/commands/hmi/get_urls.cc
+++ b/src/components/application_manager/src/commands/hmi/get_urls.cc
@@ -35,18 +35,6 @@
#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_;
-};
-}
-
namespace application_manager {
namespace commands {
@@ -58,41 +46,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;
@@ -162,58 +223,7 @@ void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
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;
- }
- }
- }
- SendResponseToHMI(Common_Result::SUCCESS);
-}
-
-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 920c6fbdf9..0bcb26df8a 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
@@ -58,21 +58,24 @@ AudioStartStreamRequest::~AudioStartStreamRequest() {}
void AudioStartStreamRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
- SetAllowedToTerminate(false);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
- correlation_id());
-
+ if (!CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
ApplicationSharedPtr app =
application_manager_.application_by_hmi_app(application_id());
- if (app) {
- app->set_audio_streaming_allowed(true);
- SendRequest();
- } else {
+ if (!app) {
LOG4CXX_ERROR(logger_,
"Applcation with hmi_app_id " << application_id()
<< " does not exist");
+ return;
}
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
+ correlation_id());
+ app->set_audio_streaming_allowed(true);
+ SendRequest();
}
void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
@@ -124,7 +127,8 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
void AudioStartStreamRequest::onTimeOut() {
RetryStartSession();
- application_manager_.TerminateRequest(connection_key(), correlation_id());
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
}
void AudioStartStreamRequest::RetryStartSession() {
@@ -152,7 +156,7 @@ void AudioStartStreamRequest::RetryStartSession() {
}
uint32_t curr_retry_number = app->audio_stream_retry_number();
- if (curr_retry_number < retry_number_ - 1) {
+ if (curr_retry_number < retry_number_) {
LOG4CXX_DEBUG(
logger_,
"Send AudioStartStream retry. retry_number = " << curr_retry_number);
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
index d0f1a96282..f86ee8302a 100644
--- a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
+++ b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
@@ -43,7 +43,11 @@ AudioStopStreamRequest::~AudioStopStreamRequest() {}
void AudioStopStreamRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ if (!CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
SendRequest();
}
diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
index 92e972e8f4..4392258a31 100644
--- a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
+++ b/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
@@ -38,16 +38,42 @@ namespace commands {
NaviIsReadyRequest::NaviIsReadyRequest(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
+ : RequestToHMI(message, application_manager)
+ , EventObserver(application_manager.event_dispatcher()) {}
NaviIsReadyRequest::~NaviIsReadyRequest() {}
void NaviIsReadyRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_IsReady,
+ correlation_id());
SendRequest();
}
+void NaviIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received Navigation_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_IsReady);
+ const bool is_available =
+ ChangeInterfaceState(application_manager_,
+ message,
+ HmiInterfaces::HMI_INTERFACE_Navigation);
+
+ HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+ hmi_capabilities.set_is_navi_cooperating(is_available);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
index 129900c60f..7daba4258b 100644
--- a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
+++ b/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
@@ -43,16 +43,9 @@ NaviIsReadyResponse::~NaviIsReadyResponse() {}
void NaviIsReadyResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& object = *message_;
-
- bool is_available = false;
- if (object[strings::msg_params].keyExists(strings::available)) {
- is_available = object[strings::msg_params][strings::available].asBool();
- }
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_is_navi_cooperating(is_available);
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
}
} // namespace commands
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 f0104cbaee..b06c69e703 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
@@ -58,21 +58,24 @@ NaviStartStreamRequest::~NaviStartStreamRequest() {}
void NaviStartStreamRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
- SetAllowedToTerminate(false);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
- correlation_id());
-
+ if (!CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
ApplicationSharedPtr app =
application_manager_.application_by_hmi_app(application_id());
- if (app) {
- app->set_video_streaming_allowed(true);
- SendRequest();
- } else {
+ if (!app) {
LOG4CXX_ERROR(logger_,
"Applcation with hmi_app_id " << application_id()
<< "does not exist");
+ return;
}
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
+ correlation_id());
+ app->set_video_streaming_allowed(true);
+ SendRequest();
}
void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
@@ -110,7 +113,7 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
}
if (hmi_apis::Common_Result::REJECTED == code) {
LOG4CXX_INFO(logger_, "StartStream response REJECTED ");
- SendRequest();
+ RetryStartSession();
break;
}
}
@@ -124,7 +127,8 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
void NaviStartStreamRequest::onTimeOut() {
RetryStartSession();
- application_manager_.TerminateRequest(connection_key(), correlation_id());
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
}
void NaviStartStreamRequest::RetryStartSession() {
@@ -152,7 +156,7 @@ void NaviStartStreamRequest::RetryStartSession() {
}
uint32_t curr_retry_number = app->video_stream_retry_number();
- if (curr_retry_number < retry_number_ - 1) {
+ if (curr_retry_number < retry_number_) {
LOG4CXX_DEBUG(
logger_,
"Send NaviStartStream retry. retry_number = " << curr_retry_number);
diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
index 4b72ff28b4..a40ee13b68 100644
--- a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
+++ b/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
@@ -12,7 +12,11 @@ NaviStopStreamRequest::~NaviStopStreamRequest() {}
void NaviStopStreamRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ if (!CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
SendRequest();
}
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_exit_application_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
index a7b6b9a2cd..0553fbba94 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
@@ -68,11 +68,6 @@ void OnExitApplicationNotification::Run() {
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 +95,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..5383876714 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,13 @@ 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(ODOMETER,
+ msg_params[strings::odometer].asInt());
+ }
+
SendNotificationToMobile(message_);
}
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..1119e7c4fd 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
@@ -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 2e7d7e9df1..39d549ac72 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
@@ -36,6 +36,29 @@ namespace application_manager {
namespace commands {
+bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
+ HmiInterfaces::InterfaceID interface) {
+ const HmiInterfaces::InterfaceState state =
+ application_manager.hmi_interfaces().GetInterfaceState(interface);
+ return HmiInterfaces::STATE_NOT_AVAILABLE != state;
+}
+
+bool ChangeInterfaceState(ApplicationManager& application_manager,
+ const smart_objects::SmartObject& response_from_hmi,
+ HmiInterfaces::InterfaceID interface) {
+ if (response_from_hmi[strings::msg_params].keyExists(strings::available)) {
+ const bool is_available =
+ response_from_hmi[strings::msg_params][strings::available].asBool();
+ const HmiInterfaces::InterfaceState interface_state =
+ is_available ? HmiInterfaces::STATE_AVAILABLE
+ : HmiInterfaces::STATE_NOT_AVAILABLE;
+ application_manager.hmi_interfaces().SetInterfaceState(interface,
+ interface_state);
+ return is_available;
+ }
+ return false;
+}
+
RequestToHMI::RequestToHMI(const MessageSharedPtr& message,
ApplicationManager& application_manager)
: CommandImpl(message, application_manager) {
@@ -58,7 +81,6 @@ void RequestToHMI::Run() {}
void RequestToHMI::SendRequest() {
(*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
(*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
application_manager_.SendMessageToHMI(message_);
}
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..3a5a8d25f9 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
@@ -84,6 +84,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 +154,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 +182,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 +209,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 +242,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/tts_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
index e7fd335808..71e89dd9b9 100644
--- a/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
+++ b/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
@@ -31,6 +31,7 @@
*/
#include "application_manager/commands/hmi/tts_is_ready_request.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -38,16 +39,68 @@ namespace commands {
TTSIsReadyRequest::TTSIsReadyRequest(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
+ : RequestToHMI(message, application_manager)
+ , EventObserver(application_manager.event_dispatcher()) {}
TTSIsReadyRequest::~TTSIsReadyRequest() {}
void TTSIsReadyRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ subscribe_on_event(hmi_apis::FunctionID::TTS_IsReady, correlation_id());
SendRequest();
}
+void TTSIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received TTS_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_IsReady);
+ const bool is_available = ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_TTS);
+ HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+ hmi_capabilities.set_is_tts_cooperating(is_available);
+ if (!CheckAvailabilityHMIInterfaces(application_manager_,
+ HmiInterfaces::HMI_INTERFACE_TTS)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_TTS isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void TTSIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void TTSIsReadyRequest::SendMessageToHMI() {
+ utils::SharedPtr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
+ hmi_capabilities.set_handle_response_for(*get_language);
+ application_manager_.ManageHMICommand(get_language);
+ utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetSupportedLanguages,
+ application_manager_));
+ application_manager_.ManageHMICommand(get_all_languages);
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetCapabilities, application_manager_));
+ application_manager_.ManageHMICommand(get_capabilities);
+}
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
index 91efb293c9..30e2f4816b 100644
--- a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
+++ b/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
@@ -43,15 +43,9 @@ TTSIsReadyResponse::~TTSIsReadyResponse() {}
void TTSIsReadyResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& object = *message_;
-
- bool is_available = false;
- if (object[strings::msg_params].keyExists(strings::available)) {
- is_available = object[strings::msg_params][strings::available].asBool();
- }
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_tts_cooperating(is_available);
+ event_engine::Event event(hmi_apis::FunctionID::TTS_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
index 463ae9d41d..9e27e23d34 100644
--- a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
@@ -31,6 +31,7 @@
*/
#include "application_manager/commands/hmi/ui_is_ready_request.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -38,16 +39,68 @@ namespace commands {
UIIsReadyRequest::UIIsReadyRequest(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
+ : RequestToHMI(message, application_manager)
+ , EventObserver(application_manager.event_dispatcher()) {}
UIIsReadyRequest::~UIIsReadyRequest() {}
void UIIsReadyRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ subscribe_on_event(hmi_apis::FunctionID::UI_IsReady, correlation_id());
SendRequest();
}
+void UIIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received UI_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_IsReady);
+ const bool is_available = ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_UI);
+ HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+ hmi_capabilities.set_is_ui_cooperating(is_available);
+ if (!CheckAvailabilityHMIInterfaces(application_manager_,
+ HmiInterfaces::HMI_INTERFACE_UI)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_UI isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void UIIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void UIIsReadyRequest::SendMessageToHMI() {
+ utils::SharedPtr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
+ hmi_capabilities.set_handle_response_for(*get_language);
+ application_manager_.ManageHMICommand(get_language);
+ utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetSupportedLanguages,
+ application_manager_));
+ application_manager_.ManageHMICommand(get_all_languages);
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetCapabilities, application_manager_));
+ application_manager_.ManageHMICommand(get_capabilities);
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
index e7fca943bc..088baeb8b2 100644
--- a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
@@ -43,16 +43,10 @@ UIIsReadyResponse::~UIIsReadyResponse() {}
void UIIsReadyResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& object = *message_;
- bool is_available = false;
- if (object[strings::msg_params].keyExists(strings::available)) {
- is_available = object[strings::msg_params][strings::available].asBool();
- }
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_is_ui_cooperating(is_available);
+ event_engine::Event event(hmi_apis::FunctionID::UI_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
}
} // namespace commands
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/hmi/vi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
index 3ecc2ffe90..ddd08695a0 100644
--- a/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
+++ b/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
@@ -31,6 +31,7 @@
*/
#include "application_manager/commands/hmi/vi_is_ready_request.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -38,16 +39,65 @@ namespace commands {
VIIsReadyRequest::VIIsReadyRequest(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
+ : RequestToHMI(message, application_manager)
+ , EventObserver(application_manager.event_dispatcher()) {}
VIIsReadyRequest::~VIIsReadyRequest() {}
void VIIsReadyRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ subscribe_on_event(hmi_apis::FunctionID::VehicleInfo_IsReady,
+ correlation_id());
SendRequest();
}
+void VIIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_IsReady: {
+ LOG4CXX_DEBUG(logger_, "VehicleInfo_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ const bool is_available =
+ ChangeInterfaceState(application_manager_,
+ message,
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+ hmi_capabilities.set_is_ivi_cooperating(is_available);
+ application_manager_.GetPolicyHandler().OnVIIsReady();
+ if (!CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
+ LOG4CXX_INFO(
+ logger_,
+ "HmiInterfaces::HMI_INTERFACE_VehicleInfo isn't available");
+ return;
+ }
+ SendMessageToHMI();
+
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void VIIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void VIIsReadyRequest::SendMessageToHMI() {
+ utils::SharedPtr<smart_objects::SmartObject> get_type(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
+ application_manager_));
+ application_manager_.ManageHMICommand(get_type);
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
index 91dae226b6..2f84190494 100644
--- a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
+++ b/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
@@ -43,17 +43,9 @@ VIIsReadyResponse::~VIIsReadyResponse() {}
void VIIsReadyResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& object = *message_;
-
- bool is_available = false;
- if (object[strings::msg_params].keyExists(strings::available)) {
- is_available = object[strings::msg_params][strings::available].asBool();
- }
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_ivi_cooperating(is_available);
-
- application_manager_.GetPolicyHandler().OnVIIsReady();
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
index 8c5e8bd49b..086b5d4490 100644
--- a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
+++ b/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
@@ -38,16 +38,69 @@ namespace commands {
VRIsReadyRequest::VRIsReadyRequest(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
+ : RequestToHMI(message, application_manager)
+ , EventObserver(application_manager.event_dispatcher()) {}
VRIsReadyRequest::~VRIsReadyRequest() {}
void VRIsReadyRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ subscribe_on_event(hmi_apis::FunctionID::VR_IsReady, correlation_id());
SendRequest();
}
+void VRIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VR_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received VR_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::VR_IsReady);
+ const bool is_available = ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_VR);
+
+ HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+ hmi_capabilities.set_is_vr_cooperating(is_available);
+ if (!CheckAvailabilityHMIInterfaces(application_manager_,
+ HmiInterfaces::HMI_INTERFACE_VR)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_VR isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void VRIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void VRIsReadyRequest::SendMessageToHMI() {
+ utils::SharedPtr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
+ hmi_capabilities.set_handle_response_for(*get_language);
+ application_manager_.ManageHMICommand(get_language);
+ utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VR_GetSupportedLanguages,
+ application_manager_));
+ application_manager_.ManageHMICommand(get_all_languages);
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VR_GetCapabilities, application_manager_));
+ application_manager_.ManageHMICommand(get_capabilities);
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
index 617742a28c..78e2dae23b 100644
--- a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
+++ b/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
@@ -43,15 +43,9 @@ VRIsReadyResponse::~VRIsReadyResponse() {}
void VRIsReadyResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& object = *message_;
-
- bool is_available = false;
- if (object[strings::msg_params].keyExists(strings::available)) {
- is_available = object[strings::msg_params][strings::available].asBool();
- }
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_vr_cooperating(is_available);
+ event_engine::Event event(hmi_apis::FunctionID::VR_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
}
} // namespace commands
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 03bdfadd66..a76f537a24 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
@@ -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
@@ -289,6 +289,7 @@ bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) {
return true;
}
+// TODO(AKUTSAN) APPLINK-26973: Refactor AddCommandRequest
void AddCommandRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
using namespace helpers;
@@ -314,7 +315,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
+ GetInfo(message, ui_info_);
if (hmi_apis::Common_Result::SUCCESS != ui_result_) {
(*message_)[strings::msg_params].erase(strings::menu_params);
}
@@ -325,7 +326,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
is_vr_received_ = true;
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
+ GetInfo(message, vr_info_);
if (hmi_apis::Common_Result::SUCCESS != vr_result_) {
(*message_)[strings::msg_params].erase(strings::vr_commands);
}
@@ -341,10 +342,6 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
return;
}
- if (hmi_apis::Common_Result::REJECTED == ui_result_) {
- RemoveCommand();
- }
-
smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
msg_params[strings::cmd_id] =
(*message_)[strings::msg_params][strings::cmd_id];
@@ -358,37 +355,73 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
hmi_apis::Common_Result::INVALID_ENUM,
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
- const bool is_ui_ivalid_unsupported =
+ const bool is_ui_invalid_unsupported =
Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
ui_result_,
hmi_apis::Common_Result::INVALID_ENUM,
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+ const bool is_vr_unsupported =
+ vr_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ const bool is_ui_unsupported =
+ ui_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
const bool is_no_ui_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
ui_result_,
hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS);
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
const bool is_no_vr_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
vr_result_,
hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS);
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
bool result = (is_no_ui_error && is_no_vr_error) ||
(is_no_ui_error && is_vr_invalid_unsupported) ||
- (is_no_vr_error && is_ui_ivalid_unsupported);
+ (is_no_vr_error && is_ui_invalid_unsupported);
+ LOG4CXX_DEBUG(logger_,
+ "calculated result " << ui_result_ << " " << is_no_ui_error
+ << " " << is_no_vr_error);
const bool is_vr_or_ui_warning =
Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
+ const bool is_vr_or_ui_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ ui_result_,
+ vr_result_);
+
+ const bool is_vr_and_ui_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ ui_result_,
+ vr_result_);
+
if (!result && hmi_apis::Common_Result::REJECTED == ui_result_) {
result_code = MessageHelper::HMIToMobileResult(ui_result_);
+ } else if (result && is_vr_or_ui_unsupported) {
+ result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
} else if (is_vr_or_ui_warning) {
result_code = mobile_apis::Result::WARNINGS;
} else {
result_code =
MessageHelper::HMIToMobileResult(std::max(ui_result_, vr_result_));
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_) {
+ result_code = MessageHelper::HMIToMobileResult(vr_result_);
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == vr_result_) {
+ result_code = MessageHelper::HMIToMobileResult(ui_result_);
+ }
+ LOG4CXX_DEBUG(logger_, "HMIToMobileResult " << result_code);
}
if (BothSend() && hmi_apis::Common_Result::SUCCESS == vr_result_) {
@@ -410,11 +443,13 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
application->RemoveCommand(
(*message_)[strings::msg_params][strings::cmd_id].asUInt());
result = false;
+ LOG4CXX_DEBUG(logger_, "Result " << result);
}
}
if (BothSend() && hmi_apis::Common_Result::SUCCESS == ui_result_ &&
- !is_no_vr_error) {
+ !is_no_vr_error &&
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
result_code = vr_result_ == hmi_apis::Common_Result::REJECTED
? mobile_apis::Result::REJECTED
: mobile_apis::Result::GENERIC_ERROR;
@@ -424,9 +459,39 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
application->RemoveCommand(
(*message_)[strings::msg_params][strings::cmd_id].asUInt());
result = false;
+ LOG4CXX_DEBUG(logger_, "Result " << result);
+ }
+
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
+ HmiInterfaces::InterfaceState vr_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VR);
+
+ if (!BothSend() &&
+ ((is_vr_unsupported &&
+ HmiInterfaces::STATE_NOT_AVAILABLE == vr_interface_state) ||
+ (is_ui_unsupported &&
+ HmiInterfaces::STATE_NOT_AVAILABLE == ui_interface_state))) {
+ LOG4CXX_DEBUG(logger_, "!BothSend() && is_vr_or_ui_unsupported");
+ result = false;
+ }
+
+ if (is_vr_and_ui_unsupported) {
+ LOG4CXX_DEBUG(logger_, "UI and VR interface both unsupported");
+ result = false;
}
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ if (!result) {
+ RemoveCommand();
+ }
+
+ const std::string info = GenerateMobileResponseInfo();
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ &(message[strings::msg_params]));
if (result) {
application->UpdateHash();
@@ -479,6 +544,35 @@ bool AddCommandRequest::BothSend() const {
return send_vr_ && send_ui_;
}
+const std::string AddCommandRequest::GenerateMobileResponseInfo() {
+ // In case if vr_result_ is UNSUPPORTED_RESOURCE vr_info should be on the
+ // first place
+ // In case if ui_result_ is UNSUPPORTED_RESOURCE ui_info should be on the
+ // first place
+ // Other way order is doesn't matter
+
+ HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ HmiInterfaces::InterfaceState ui_interface_state =
+ hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_UI);
+
+ HmiInterfaces::InterfaceState vr_interface_state =
+ hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_VR);
+
+ if ((ui_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (vr_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !vr_info_.empty()) {
+ return vr_info_;
+ }
+
+ if ((vr_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (ui_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !ui_info_.empty()) {
+ return ui_info_;
+ }
+
+ return MergeInfos(ui_info_, vr_info_);
+}
+
void AddCommandRequest::RemoveCommand() {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application_manager_.application(connection_key());
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 83f137ac19..6838d1af7d 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
@@ -33,6 +33,7 @@
#include "application_manager/commands/mobile/add_sub_menu_request.h"
+#include "application_manager/message_helper.h"
#include "application_manager/application.h"
#include "utils/helpers.h"
@@ -98,19 +99,17 @@ void AddSubMenuRequest::Run() {
void AddSubMenuRequest::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_AddSubMenu: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::SUCCESS,
- mobile_api::Result::WARNINGS);
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
ApplicationSharedPtr application =
application_manager_.application(connection_key());
@@ -125,7 +124,10 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) {
(*message_)[strings::msg_params][strings::menu_id].asInt(),
(*message_)[strings::msg_params]);
}
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
if (result) {
application->UpdateHash();
}
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 ea00bc8d70..b151990289 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
@@ -1,22 +1,17 @@
/*
Copyright (c) 2016, Ford Motor Company
All rights reserved.
-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the
distribution.
-
Neither the name of the Ford Motor Company nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -33,11 +28,9 @@
#include <cstring>
#include <string>
#include "application_manager/commands/mobile/alert_maneuver_request.h"
-
#include "application_manager/application_impl.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
namespace application_manager {
@@ -46,8 +39,8 @@ namespace commands {
AlertManeuverRequest::AlertManeuverRequest(
const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager)
- , tts_speak_result_code_(mobile_apis::Result::INVALID_ENUM)
- , navi_alert_maneuver_result_code_(mobile_apis::Result::INVALID_ENUM) {
+ , tts_speak_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
+ , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
}
@@ -136,66 +129,24 @@ void AlertManeuverRequest::Run() {
void AlertManeuverRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
const smart_objects::SmartObject& message = event.smart_object();
- bool is_tts_ok;
- bool is_no_navi_error;
- hmi_apis::Common_Result::eType tts_result;
- hmi_apis::Common_Result::eType navi_result;
hmi_apis::FunctionID::eType event_id = event.id();
switch (event_id) {
case hmi_apis::FunctionID::Navigation_AlertManeuver: {
LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event");
-
pending_requests_.Remove(event_id);
-
navi_alert_maneuver_result_code_ =
- static_cast<mobile_apis::Result::eType>(
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
- navi_result =
- MessageHelper::MobileToHMIResult(navi_alert_maneuver_result_code_);
- is_no_navi_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- navi_result,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS);
-
- const bool is_navi_success =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- navi_result, hmi_apis::Common_Result::SUCCESS);
- if (is_navi_success) {
- info_navi_ =
- message[strings::msg_params][hmi_response::message].asString();
- } else {
- info_navi_ = message[strings::msg_params][strings::info].asString();
- }
+ GetInfo(message, info_navi_);
break;
}
case hmi_apis::FunctionID::TTS_Speak: {
LOG4CXX_INFO(logger_, "Received TTS_Speak event");
-
pending_requests_.Remove(event_id);
-
- tts_speak_result_code_ = static_cast<mobile_apis::Result::eType>(
+ tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- tts_result = MessageHelper::MobileToHMIResult(tts_speak_result_code_);
-
- is_tts_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- tts_result,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::INVALID_ENUM);
-
- const bool is_tts_success =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- tts_result, hmi_apis::Common_Result::SUCCESS);
- if (is_tts_success) {
- info_tts_ =
- message[strings::msg_params][hmi_response::message].asString();
- } else {
- info_tts_ = message[strings::msg_params][strings::info].asString();
- }
+ GetInfo(message, info_tts_);
break;
}
case hmi_apis::FunctionID::TTS_OnResetTimeout: {
@@ -219,32 +170,9 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) {
"AlertManeuverRequest still waiting.");
return;
}
-
- const bool result =
- (is_tts_ok && is_no_navi_error) ||
- (hmi_apis::Common_Result::SUCCESS == tts_result &&
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == navi_result);
-
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
- std::max(tts_speak_result_code_, navi_alert_maneuver_result_code_));
-
std::string return_info;
-
- const bool is_tts_or_navi_warning =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::WARNINGS, tts_result, navi_result);
-
- if (result && (is_tts_or_navi_warning ||
- 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");
- }
-
- if (!info_tts_.empty() && !info_navi_.empty()) {
- info_tts_ += ". ";
- }
- return_info = info_tts_ + info_navi_;
+ mobile_apis::Result::eType result_code;
+ const bool result = PrepareResponseParameters(result_code, return_info);
bool must_be_empty_info = false;
if (return_info.find("\n") != std::string::npos ||
return_info.find("\t") != std::string::npos) {
@@ -256,6 +184,36 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) {
&(message[strings::msg_params]));
}
+bool AlertManeuverRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& return_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ application_manager::commands::ResponseInfo navigation_alert_info(
+ navi_alert_maneuver_result_code_,
+ HmiInterfaces::HMI_INTERFACE_Navigation);
+
+ application_manager::commands::ResponseInfo tts_alert_info(
+ tts_speak_result_code_, HmiInterfaces::HMI_INTERFACE_TTS);
+ const bool result =
+ PrepareResultForMobileResponse(navigation_alert_info, tts_alert_info);
+
+ if (result && (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
+ tts_speak_result_code_ &&
+ (HmiInterfaces::STATE_AVAILABLE ==
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS)))) {
+ result_code = mobile_apis::Result::WARNINGS;
+ return_info = std::string("Unsupported phoneme type sent in a prompt");
+ return result;
+ }
+ result_code =
+ PrepareResultCodeForResponse(navigation_alert_info, tts_alert_info);
+ return_info =
+ MergeInfos(navigation_alert_info, info_navi_, tts_alert_info, info_tts_);
+ return result;
+}
+
bool AlertManeuverRequest::IsWhiteSpaceExist() {
LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
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 53910a05b7..3288870b92 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)
@@ -55,8 +54,8 @@ AlertRequest::AlertRequest(const MessageSharedPtr& message,
, awaiting_tts_stop_speaking_response_(false)
, is_alert_succeeded_(false)
, is_ui_alert_sent_(false)
- , alert_result_(mobile_apis::Result::INVALID_ENUM)
- , tts_speak_result_(mobile_apis::Result::INVALID_ENUM) {
+ , alert_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {
subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
}
@@ -131,8 +130,6 @@ void AlertRequest::onTimeOut() {
void AlertRequest::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()) {
@@ -153,26 +150,21 @@ void AlertRequest::on_event(const event_engine::Event& event) {
// Unsubscribe from event to avoid unwanted messages
unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert);
awaiting_ui_alert_response_ = false;
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
- if (awaiting_tts_speak_response_) {
+ if (awaiting_tts_speak_response_ &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state) {
awaiting_tts_stop_speaking_response_ = true;
SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL, true);
}
+ alert_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
- message[strings::params][hmi_response::code].asInt());
// Mobile Alert request is successful when UI_Alert is successful
-
- const bool is_alert_ok = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_apis::Result::SUCCESS,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- mobile_apis::Result::WARNINGS);
-
- is_alert_succeeded_ = is_alert_ok;
- alert_result_ = result_code;
alert_response_params_ = message[strings::msg_params];
+ GetInfo(message, ui_response_info_);
break;
}
case hmi_apis::FunctionID::TTS_Speak: {
@@ -180,8 +172,9 @@ void AlertRequest::on_event(const event_engine::Event& event) {
// Unsubscribe from event to avoid unwanted messages
unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak);
awaiting_tts_speak_response_ = false;
- tts_speak_result_ = static_cast<mobile_apis::Result::eType>(
+ tts_speak_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
break;
}
case hmi_apis::FunctionID::TTS_StopSpeaking: {
@@ -200,56 +193,44 @@ void AlertRequest::on_event(const event_engine::Event& event) {
if (HasHmiResponsesToWait()) {
return;
}
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string info;
+ const bool result = PrepareResponseParameters(result_code, info);
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ &alert_response_params_);
+}
- const bool is_tts_alert_unsupported =
- Compare<mobile_api::Result::eType, EQ, ALL>(
- mobile_api::Result::UNSUPPORTED_RESOURCE,
- tts_speak_result_,
- alert_result_);
-
- const bool is_alert_ok = Compare<mobile_api::Result::eType, EQ, ONE>(
- alert_result_, mobile_api::Result::SUCCESS, mobile_api::Result::WARNINGS);
-
- std::string response_info;
- if (mobile_apis::Result::UNSUPPORTED_RESOURCE == tts_speak_result_ &&
- !is_ui_alert_sent_) {
- is_alert_succeeded_ = false;
- alert_result_ = mobile_apis::Result::WARNINGS;
- response_info = "Unsupported phoneme type sent in a prompt";
- } else if (is_tts_alert_unsupported) {
- alert_result_ = mobile_apis::Result::WARNINGS;
- response_info =
- "Unsupported phoneme type sent in a prompt and "
- "unsupported image sent in soft buttons";
- } else if (mobile_apis::Result::UNSUPPORTED_RESOURCE == tts_speak_result_ &&
- is_alert_ok) {
- alert_result_ = mobile_apis::Result::WARNINGS;
- response_info = "Unsupported phoneme type sent in a prompt";
- } else if (mobile_apis::Result::SUCCESS == tts_speak_result_ &&
- (mobile_apis::Result::INVALID_ENUM == alert_result_ &&
- !is_ui_alert_sent_)) {
- alert_result_ = mobile_apis::Result::SUCCESS;
- is_alert_succeeded_ = true;
- }
-
- const bool is_tts_not_ok =
- Compare<mobile_api::Result::eType, EQ, ONE>(tts_speak_result_,
- mobile_api::Result::ABORTED,
- mobile_api::Result::REJECTED);
-
- if (is_tts_not_ok && !is_ui_alert_sent_) {
- is_alert_succeeded_ = false;
- alert_result_ = tts_speak_result_;
+bool AlertRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ ResponseInfo ui_alert_info(alert_result_, HmiInterfaces::HMI_INTERFACE_UI);
+ ResponseInfo tts_alert_info(tts_speak_result_,
+ HmiInterfaces::HMI_INTERFACE_TTS);
+
+ bool result = PrepareResultForMobileResponse(ui_alert_info, tts_alert_info);
+
+ /* result=false if UI interface is ok and TTS interface = UNSUPPORTED_RESOURCE
+ * and sdl receive TTS.IsReady=true or SDL doesn't receive responce for
+ * TTS.IsReady.
+ */
+ if (result && ui_alert_info.is_ok && tts_alert_info.is_unsupported_resource &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != tts_alert_info.interface_state) {
+ result = false;
}
-
- if (mobile_apis::Result::WARNINGS == tts_speak_result_) {
- alert_result_ = mobile_apis::Result::WARNINGS;
+ result_code = mobile_apis::Result::WARNINGS;
+ if ((ui_alert_info.is_ok || ui_alert_info.is_invalid_enum) &&
+ tts_alert_info.is_unsupported_resource &&
+ HmiInterfaces::STATE_AVAILABLE == tts_alert_info.interface_state) {
+ tts_response_info_ = "Unsupported phoneme type sent in a prompt";
+ info = MergeInfos(
+ ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
+ return result;
}
-
- SendResponse(is_alert_succeeded_,
- alert_result_,
- response_info.empty() ? NULL : response_info.c_str(),
- &alert_response_params_);
+ result_code = PrepareResultCodeForResponse(ui_alert_info, tts_alert_info);
+ info = MergeInfos(
+ ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
+ return result;
}
bool AlertRequest::Validate(uint32_t app_id) {
@@ -263,7 +244,7 @@ bool AlertRequest::Validate(uint32_t app_id) {
}
if (mobile_apis::HMILevel::HMI_BACKGROUND == app->hmi_level() &&
- app->IsCommandLimitsExceeded(
+ app->AreCommandLimitsExceeded(
static_cast<mobile_apis::FunctionID::eType>(function_id()),
application_manager::TLimitSource::POLICY_TABLE)) {
LOG4CXX_ERROR(logger_, "Alert frequency is too high.");
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 63339fdc33..f1f3b93e24 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
@@ -38,6 +38,7 @@
#include "application_manager/application_impl.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
namespace {
namespace custom_str = utils::custom_string;
@@ -69,9 +70,6 @@ void ChangeRegistrationRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
using namespace smart_objects;
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
-
ApplicationSharedPtr app = application_manager_.application(connection_key());
if (!app) {
LOG4CXX_ERROR(logger_, "NULL pointer");
@@ -91,18 +89,6 @@ void ChangeRegistrationRequest::Run() {
return;
}
- if (!hmi_capabilities.is_ui_cooperating()) {
- ui_result_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- }
-
- if (!hmi_capabilities.is_vr_cooperating()) {
- vr_result_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- }
-
- if (!hmi_capabilities.is_tts_cooperating()) {
- tts_result_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- }
-
SmartObject& msg_params = (*message_)[strings::msg_params];
const int32_t hmi_language =
@@ -174,15 +160,6 @@ void ChangeRegistrationRequest::Run() {
hmi_apis::FunctionID::TTS_ChangeRegistration, &tts_params, true);
}
-bool ChangeRegistrationRequest::AllHmiResponsesSuccess(
- const hmi_apis::Common_Result::eType ui,
- const hmi_apis::Common_Result::eType vr,
- const hmi_apis::Common_Result::eType tts) {
- return hmi_apis::Common_Result::SUCCESS == ui &&
- hmi_apis::Common_Result::SUCCESS == vr &&
- hmi_apis::Common_Result::SUCCESS == tts;
-}
-
void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
@@ -195,6 +172,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
pending_requests_.Remove(event_id);
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
break;
}
case hmi_apis::FunctionID::VR_ChangeRegistration: {
@@ -202,6 +180,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
pending_requests_.Remove(event_id);
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, vr_response_info_);
break;
}
case hmi_apis::FunctionID::TTS_ChangeRegistration: {
@@ -209,6 +188,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
pending_requests_.Remove(event_id);
tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
break;
}
default: {
@@ -237,16 +217,16 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
application->set_language(static_cast<mobile_api::Language::eType>(
(*message_)[strings::msg_params][strings::language].asInt()));
}
-
- int32_t greates_result_code =
- std::max(std::max(ui_result_, vr_result_), tts_result_);
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
(*message_)[strings::params][strings::function_id] =
mobile_apis::FunctionID::eType::ChangeRegistrationID;
- SendResponse(AllHmiResponsesSuccess(ui_result_, vr_result_, tts_result_),
- static_cast<mobile_apis::Result::eType>(greates_result_code),
- NULL,
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
} else {
LOG4CXX_INFO(logger_,
@@ -255,6 +235,137 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
}
}
+namespace {
+void CheckInfo(std::string& str) {
+ if (std::string::npos != str.find("is not supported by system")) {
+ str.clear();
+ }
+}
+} // namespace
+
+bool ChangeRegistrationRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& response_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ const bool is_tts_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ tts_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_ui_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_vr_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ vr_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_tts_ui_vr_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ tts_result_,
+ ui_result_,
+ vr_result_);
+
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ const HmiInterfaces::InterfaceState tts_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
+ const HmiInterfaces::InterfaceState vr_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
+ const HmiInterfaces::InterfaceState ui_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
+
+ ResponseInfo ui_properties_info(ui_result_, HmiInterfaces::HMI_INTERFACE_UI);
+
+ ResponseInfo tts_properties_info(tts_result_,
+ HmiInterfaces::HMI_INTERFACE_TTS);
+
+ ResponseInfo vr_properties_info(ui_result_, HmiInterfaces::HMI_INTERFACE_VR);
+
+ bool result = ((!is_tts_ui_vr_unsupported) && is_tts_succeeded_unsupported &&
+ is_ui_succeeded_unsupported && is_vr_succeeded_unsupported);
+
+ const bool is_tts_or_ui_or_vr_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ tts_result_,
+ ui_result_,
+ vr_result_);
+
+ if ((result && is_tts_or_ui_or_vr_unsupported)) {
+ result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ result =
+ PrepareResultForMobileResponse(ui_properties_info,
+ tts_properties_info) &&
+ PrepareResultForMobileResponse(tts_properties_info, vr_properties_info);
+ } else {
+ // If response contains erroneous result code SDL need return erroneus
+ // result code.
+ hmi_apis::Common_Result::eType ui_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType vr_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType tts_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != ui_result_) {
+ ui_result = ui_result_;
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
+ vr_result = vr_result_;
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != tts_result_) {
+ tts_result = tts_result_;
+ }
+ result_code = MessageHelper::HMIToMobileResult(
+ std::max(std::max(ui_result, vr_result), tts_result));
+ }
+
+ const bool is_tts_state_available =
+ tts_state == HmiInterfaces::STATE_AVAILABLE;
+ const bool is_vr_state_available = vr_state == HmiInterfaces::STATE_AVAILABLE;
+ const bool is_ui_state_available = ui_state == HmiInterfaces::STATE_AVAILABLE;
+
+ const bool is_tts_hmi_info =
+ is_tts_state_available && !tts_response_info_.empty();
+ const bool is_vr_hmi_info =
+ is_vr_state_available && !vr_response_info_.empty();
+ const bool is_ui_hmi_info =
+ is_ui_state_available && !ui_response_info_.empty();
+
+ if (is_tts_hmi_info || is_vr_hmi_info || is_ui_hmi_info) {
+ if (!is_tts_hmi_info)
+ CheckInfo(tts_response_info_);
+ if (!is_vr_hmi_info)
+ CheckInfo(ui_response_info_);
+ if (!is_ui_hmi_info)
+ CheckInfo(vr_response_info_);
+ }
+
+ response_info =
+ MergeInfos(ui_response_info_, vr_response_info_, tts_response_info_);
+ return result;
+}
+
bool ChangeRegistrationRequest::IsLanguageSupportedByUI(
const int32_t& hmi_display_lang) {
const HMICapabilities& hmi_capabilities =
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 a7bb5ebc0b..46ef39d806 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
@@ -32,6 +32,7 @@
*/
#include <string>
+#include <cstring>
#include <algorithm>
#include <vector>
#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
@@ -52,7 +53,8 @@ CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
, expected_chs_count_(0)
, received_chs_count_(0)
, error_from_hmi_(false)
- , is_timed_out_(false) {}
+ , is_timed_out_(false)
+ , vr_commands_lock_(true) {}
CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -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;
}
@@ -289,6 +300,48 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests(
LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_);
}
+void CreateInteractionChoiceSetRequest::ProcessHmiError(
+ const hmi_apis::Common_Result::eType vr_result) {
+ LOG4CXX_DEBUG(logger_,
+ "Hmi response is not Success: "
+ << vr_result << ". Stop sending VRAddCommand requests");
+ if (!error_from_hmi_) {
+ error_from_hmi_ = true;
+ std::string info =
+ vr_result == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE
+ ? "VR is not supported by system"
+ : "";
+ SendResponse(false, GetMobileResultCode(vr_result), info.c_str());
+ }
+}
+
+bool CreateInteractionChoiceSetRequest::ProcessSuccesfulHMIResponse(
+ const uint32_t corr_id) {
+ SentCommandsMap::iterator it = sent_commands_map_.find(corr_id);
+ if (sent_commands_map_.end() == it) {
+ LOG4CXX_WARN(logger_, "HMI response for unknown VR command received");
+ return false;
+ }
+ VRCommandInfo& vr_command = it->second;
+ vr_command.succesful_response_received_ = true;
+ return true;
+}
+
+void CreateInteractionChoiceSetRequest::CountReceivedVRResponses() {
+ received_chs_count_++;
+ LOG4CXX_DEBUG(logger_,
+ "Got VR.AddCommand response, there are "
+ << expected_chs_count_ - received_chs_count_
+ << " more to wait.");
+ if (received_chs_count_ < expected_chs_count_) {
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ LOG4CXX_DEBUG(logger_, "Timeout for request was updated");
+ } else {
+ OnAllHMIResponsesReceived();
+ }
+}
+
void CreateInteractionChoiceSetRequest::on_event(
const event_engine::Event& event) {
using namespace hmi_apis;
@@ -296,50 +349,24 @@ void CreateInteractionChoiceSetRequest::on_event(
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
+ const Common_Result::eType result = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool is_no_error = Compare<Common_Result::eType, EQ, ONE>(
+ result, Common_Result::SUCCESS, Common_Result::WARNINGS);
+ uint32_t corr_id = static_cast<uint32_t>(
+ message[strings::params][strings::correlation_id].asUInt());
if (event.id() == hmi_apis::FunctionID::VR_AddCommand) {
- received_chs_count_++;
- LOG4CXX_DEBUG(logger_,
- "Got VR.AddCommand response, there are "
- << expected_chs_count_ - received_chs_count_
- << " more to wait.");
-
- uint32_t corr_id = static_cast<uint32_t>(
- message[strings::params][strings::correlation_id].asUInt());
{
sync_primitives::AutoLock commands_lock(vr_commands_lock_);
- SentCommandsMap::iterator it = sent_commands_map_.find(corr_id);
- if (sent_commands_map_.end() == it) {
- LOG4CXX_WARN(logger_, "HMI response for unknown VR command received");
- return;
- }
-
- Common_Result::eType vr_result = static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- const bool is_vr_no_error = Compare<Common_Result::eType, EQ, ONE>(
- vr_result, Common_Result::SUCCESS, Common_Result::WARNINGS);
-
- if (is_vr_no_error) {
- VRCommandInfo& vr_command = it->second;
- vr_command.succesful_response_received_ = true;
- } else {
- LOG4CXX_DEBUG(logger_,
- "Hmi response is not Success: "
- << vr_result
- << ". Stop sending VRAddCommand requests");
- if (!error_from_hmi_) {
- error_from_hmi_ = true;
- SendResponse(false, GetMobileResultCode(vr_result));
+ if (is_no_error) {
+ if (!ProcessSuccesfulHMIResponse(corr_id)) {
+ return;
}
+ } else {
+ ProcessHmiError(result);
}
}
- if (received_chs_count_ < expected_chs_count_) {
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- LOG4CXX_DEBUG(logger_, "Timeout for request was updated");
- return;
- }
- OnAllHMIResponsesReceived();
+ CountReceivedVRResponses();
}
}
@@ -355,7 +382,8 @@ void CreateInteractionChoiceSetRequest::onTimeOut() {
// according to SDLAQ-CRS-2976
sync_primitives::AutoLock timeout_lock_(is_timed_out_lock_);
is_timed_out_ = true;
- application_manager_.TerminateRequest(connection_key(), correlation_id());
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
}
void CreateInteractionChoiceSetRequest::DeleteChoices() {
@@ -381,7 +409,7 @@ void CreateInteractionChoiceSetRequest::DeleteChoices() {
SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_param);
} else {
LOG4CXX_WARN(logger_,
- "Succesfull response has not been received for cmd_id = "
+ "succesful response has not been received for cmd_id = "
<< vr_command_info.cmd_id_);
}
}
@@ -405,7 +433,8 @@ void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() {
DeleteChoices();
}
- application_manager_.TerminateRequest(connection_key(), correlation_id());
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
}
} // namespace commands
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 9a7b92f7b8..103e87fa00 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
@@ -94,16 +94,19 @@ void DeleteCommandRequest::Run() {
if ((*command).keyExists(strings::vr_commands)) {
++chaining_counter;
}
-
+ /* Need to set all flags before sending request to HMI
+ * for correct processing this flags in method on_event */
if ((*command).keyExists(strings::menu_params)) {
is_ui_send_ = true;
-
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params, true);
}
// check vr params
if ((*command).keyExists(strings::vr_commands)) {
is_vr_send_ = true;
-
+ }
+ if (is_ui_send_) {
+ 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;
@@ -111,29 +114,52 @@ 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);
+ const bool result =
+ PrepareResultForMobileResponse(ui_delete_info, vr_delete_info);
+
+ const bool is_vr_or_ui_warning =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
+ info = MergeInfos(ui_delete_info, ui_info_, vr_delete_info, vr_info_);
+ if (is_vr_or_ui_warning && !ui_delete_info.is_unsupported_resource &&
+ !vr_delete_info.is_unsupported_resource) {
+ LOG4CXX_DEBUG(logger_, "VR or UI result is warning");
+ result_code = mobile_apis::Result::WARNINGS;
+ return result;
+ }
+ result_code = PrepareResultCodeForResponse(ui_delete_info, vr_delete_info);
+ LOG4CXX_DEBUG(logger_, "Result is " << (result ? "true" : "false"));
+ return result;
+}
+
void DeleteCommandRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
const smart_objects::SmartObject& message = event.smart_object();
-
switch (event.id()) {
case hmi_apis::FunctionID::UI_DeleteCommand: {
is_ui_received_ = true;
- const int result = message[strings::params][hmi_response::code].asInt();
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(result);
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
LOG4CXX_DEBUG(logger_,
"Received UI_DeleteCommand event with result "
<< MessageHelper::HMIResultToString(ui_result_));
+ GetInfo(message, ui_info_);
break;
}
case hmi_apis::FunctionID::VR_DeleteCommand: {
is_vr_received_ = true;
- const int result = message[strings::params][hmi_response::code].asInt();
- vr_result_ = static_cast<hmi_apis::Common_Result::eType>(result);
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
LOG4CXX_DEBUG(logger_,
"Received VR_DeleteCommand event with result "
<< MessageHelper::HMIResultToString(vr_result_));
+ GetInfo(message, vr_info_);
break;
}
default: {
@@ -167,51 +193,14 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
<< connection_key());
return;
}
-
- const bool is_vr_success_invalid =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- vr_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::INVALID_ENUM);
-
- const bool is_ui_success_invalid =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::INVALID_ENUM);
-
- const bool is_vr_ui_invalid =
- Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
- hmi_apis::Common_Result::INVALID_ENUM, vr_result_, ui_result_);
-
- const bool is_vr_or_ui_warning =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
-
- const bool result =
- // In case of UI/VR is SUCCESS and other is SUCCESS/INVALID_ENUM
- (is_vr_success_invalid && is_ui_success_invalid && !is_vr_ui_invalid) ||
- // or one of them is WARNINGS
- is_vr_or_ui_warning;
-
- LOG4CXX_DEBUG(logger_, "Result code is " << (result ? "true" : "false"));
-
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string info;
+ const bool result = PrepareResponseParameters(result_code, info);
if (result) {
application->RemoveCommand(msg_params[strings::cmd_id].asInt());
}
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- if (!result && hmi_apis::Common_Result::REJECTED == ui_result_) {
- result_code = MessageHelper::HMIToMobileResult(vr_result_);
- } else if (is_vr_or_ui_warning) {
- LOG4CXX_DEBUG(logger_, "VR or UI result is warning");
- result_code = mobile_apis::Result::WARNINGS;
- } else {
- result_code =
- MessageHelper::HMIToMobileResult(std::max(ui_result_, vr_result_));
- }
-
- SendResponse(result, result_code, NULL, &msg_params);
+ SendResponse(
+ result, result_code, info.empty() ? NULL : info.c_str(), &msg_params);
if (result) {
application->UpdateHash();
}
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..31ca29cb51 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
@@ -93,7 +93,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_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc
index bdb5521921..57748e6feb 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
@@ -33,6 +33,7 @@
#include "application_manager/commands/mobile/delete_sub_menu_request.h"
+#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
#include "interfaces/HMI_API.h"
#include "utils/helpers.h"
@@ -138,19 +139,17 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands(
void DeleteSubMenuRequest::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_DeleteSubMenu: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::SUCCESS,
- mobile_api::Result::WARNINGS);
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
ApplicationSharedPtr application =
application_manager_.application(connection_key());
@@ -168,7 +167,10 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
(*message_)[strings::msg_params][strings::menu_id].asInt());
}
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
if (result) {
application->UpdateHash();
}
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 5252ea0e33..5c5d250026 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
@@ -37,6 +37,7 @@
#include "application_manager/application_impl.h"
#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -93,13 +94,17 @@ void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- bool result = mobile_apis::Result::SUCCESS == result_code;
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
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 5a922f595f..f67d1f2434 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
@@ -32,6 +32,7 @@
*/
#include "application_manager/commands/mobile/end_audio_pass_thru_request.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -55,12 +56,13 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_EndAudioPassThru: {
- mobile_apis::Result::eType mobile_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
-
- bool result = mobile_apis::Result::SUCCESS == mobile_code;
-
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
if (result) {
bool ended_successfully = application_manager_.EndAudioPassThrough();
if (ended_successfully) {
@@ -68,7 +70,10 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
}
}
- SendResponse(result, mobile_code, NULL, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
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 80bc89f853..d98207c772 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
@@ -35,6 +35,7 @@
#include "application_manager/application_impl.h"
#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -80,13 +81,19 @@ void GetDTCsRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
- bool result = mobile_apis::Result::SUCCESS == result_code;
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
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 dc36e9ad3a..25e2da3eb6 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
@@ -230,7 +230,7 @@ void GetVehicleDataRequest::Run() {
return;
}
- if (app->IsCommandLimitsExceeded(
+ if (app->AreCommandLimitsExceeded(
static_cast<mobile_apis::FunctionID::eType>(function_id()),
application_manager::TLimitSource::CONFIG_FILE)) {
LOG4CXX_ERROR(logger_, "GetVehicleData frequency is too high.");
@@ -266,26 +266,28 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
- bool result = false;
- if (mobile_apis::Result::SUCCESS == result_code ||
- (mobile_apis::Result::VEHICLE_DATA_NOT_AVAILABLE == result_code &&
- message[strings::msg_params].length() > 1)) {
- result = true;
- }
- const char* info = NULL;
- std::string error_message;
+ bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+ result = result ||
+ ((hmi_apis::Common_Result::DATA_NOT_AVAILABLE == result_code) &&
+ (message[strings::msg_params].length() > 1));
+
if (true ==
message[strings::msg_params].keyExists(hmi_response::method)) {
message[strings::msg_params].erase(hmi_response::method);
}
if (true == message[strings::params].keyExists(strings::error_msg)) {
- error_message = message[strings::params][strings::error_msg].asString();
- info = error_message.c_str();
+ response_info = message[strings::params][strings::error_msg].asString();
}
- SendResponse(result, result_code, info, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
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 9baf747ee4..198964a333 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
@@ -1,5 +1,6 @@
#include "application_manager/application_manager.h"
#include "application_manager/commands/mobile/get_way_points_request.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -35,16 +36,21 @@ void GetWayPointsRequest::Run() {
void GetWayPointsRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
case hmi_apis::FunctionID::Navigation_GetWayPoints: {
LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event");
- mobile_apis::Result::eType result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
- bool result = mobile_apis::Result::SUCCESS == result_code;
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
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 fdf8b559bc..ae6658b93a 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;
}
@@ -116,8 +127,14 @@ void OnButtonPressNotification::Run() {
<< "in FULL or LIMITED hmi level");
continue;
}
- // if "app_id" absent send notification only in HMI_FULL mode
- if (is_app_id_exists || subscribed_app->IsFullscreen()) {
+ // if "appID" is present, send it to named app only if its FULL or
+ // LIMITED
+ if (app.valid()) {
+ if (app->app_id() == subscribed_app->app_id()) {
+ SendButtonPress(subscribed_app);
+ }
+ } else if (subscribed_app->IsFullscreen()) {
+ // if No "appID" - send it FULL apps only.
SendButtonPress(subscribed_app);
}
}
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_permissions_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
index a4167a802e..09c407b8b5 100644
--- a/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
+++ b/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
@@ -48,9 +48,6 @@ OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {}
void OnPermissionsChangeNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
-
SendNotification();
}
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 b57490806c..a17c76d9c1 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,21 +78,24 @@ 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;
@@ -101,10 +104,11 @@ void OnSystemRequestNotification::Run() {
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];
@@ -149,7 +153,7 @@ void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const {
","
"\"InstanceFollowRedirects\": false,"
"\"charset\": \"utf-8\","
- "\"Content_-Length\": " +
+ "\"Content-Length\": " +
std::string(size_str) +
"},"
"\"body\": \"" +
@@ -184,7 +188,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/perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
index d595119d45..9f5fd937f9 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,10 @@ namespace str = strings;
PerformAudioPassThruRequest::PerformAudioPassThruRequest(
const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager)
- , is_active_tts_speak_(false)
- , result_tts_speak_(mobile_apis::Result::SUCCESS) {
+ , 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);
}
@@ -92,7 +94,10 @@ void PerformAudioPassThruRequest::Run() {
SendResponse(false, mobile_apis::Result::INVALID_DATA);
return;
}
+ // According with new implementation processing of UNSUPPORTE_RESOURCE
+ // need set flag before sending to hmi
+ awaiting_ui_response_ = true;
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
@@ -114,56 +119,41 @@ 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;
- if (!WaitTTSSpeak()) {
- LOG4CXX_DEBUG(logger_, "TTS.Speak is absent");
- return;
- }
-
- mobile_apis::Result::eType mobile_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
+ result_ui_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, ui_info_);
// in case perform audio is started by other request skip stopping
- if (mobile_apis::Result::REJECTED == mobile_code) {
+ if (hmi_apis::Common_Result::REJECTED == result_ui_) {
LOG4CXX_ERROR(logger_, "Request was rejected");
- SendResponse(false, mobile_code, NULL, &(message[strings::msg_params]));
+ SendResponse(false,
+ MessageHelper::HMIToMobileResult(result_ui_),
+ NULL,
+ &(message[strings::msg_params]));
return;
}
-
FinishTTSSpeak();
-
- std::string return_info;
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- mobile_code,
- mobile_apis::Result::SUCCESS,
- mobile_apis::Result::RETRY,
- mobile_apis::Result::WARNINGS);
-
- const bool is_result_ok = Compare<mobile_api::Result::eType, EQ, ONE>(
- mobile_code,
- mobile_apis::Result::SUCCESS,
- mobile_apis::Result::WARNINGS);
-
- if (is_result_ok &&
- mobile_apis::Result::UNSUPPORTED_RESOURCE == result_tts_speak_) {
- mobile_code = mobile_apis::Result::WARNINGS;
- return_info = "Unsupported phoneme type sent in a prompt";
- }
-
- SendResponse(result,
- mobile_code,
- return_info.empty() ? NULL : return_info.c_str(),
- &(message[strings::msg_params]));
break;
}
case hmi_apis::FunctionID::TTS_Speak: {
LOG4CXX_INFO(logger_, "Received TTS_Speak event");
- result_tts_speak_ =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
- is_active_tts_speak_ = false;
- if (mobile_apis::Result::SUCCESS == result_tts_speak_) {
+ 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;
+ const bool is_tts_speak_success_unsuported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ result_tts_speak_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ if (is_tts_speak_success_unsuported) {
SendRecordStartNotification();
StartMicrophoneRecording();
@@ -185,6 +175,40 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
return;
}
}
+ if (IsWaitingHMIResponse()) {
+ return;
+ }
+
+ std::string return_info;
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ const bool result = PrepareResponseParameters(result_code, return_info);
+
+ SendResponse(result,
+ result_code,
+ return_info.empty() ? NULL : return_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool PerformAudioPassThruRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ResponseInfo ui_perform_info(result_ui_, HmiInterfaces::HMI_INTERFACE_UI);
+ ResponseInfo tts_perform_info(result_tts_speak_,
+ HmiInterfaces::HMI_INTERFACE_TTS);
+ const bool result =
+ PrepareResultForMobileResponse(ui_perform_info, tts_perform_info);
+
+ 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;
+ tts_info_ = "Unsupported phoneme type sent in a prompt";
+ info = MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+ return result;
+ }
+ result_code = PrepareResultCodeForResponse(ui_perform_info, tts_perform_info);
+ info = MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+ return result;
}
void PerformAudioPassThruRequest::SendSpeakRequest() {
@@ -194,23 +218,19 @@ void PerformAudioPassThruRequest::SendSpeakRequest() {
using namespace smart_objects;
SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
-
- if ((*message_)[str::msg_params].keyExists(str::initial_prompt) &&
- (0 < (*message_)[str::msg_params][str::initial_prompt].length())) {
- for (uint32_t i = 0;
- i < (*message_)[str::msg_params][str::initial_prompt].length();
- ++i) {
- msg_params[hmi_request::tts_chunks][i][str::text] =
- (*message_)[str::msg_params][str::initial_prompt][i][str::text];
- msg_params[hmi_request::tts_chunks][i][str::type] =
- (*message_)[str::msg_params][str::initial_prompt][i][str::type];
- }
- // app_id
- msg_params[strings::app_id] = connection_key();
- msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
- is_active_tts_speak_ = true;
- SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
+ for (uint32_t i = 0;
+ i < (*message_)[str::msg_params][str::initial_prompt].length();
+ ++i) {
+ msg_params[hmi_request::tts_chunks][i][str::text] =
+ (*message_)[str::msg_params][str::initial_prompt][i][str::text];
+ msg_params[hmi_request::tts_chunks][i][str::type] =
+ (*message_)[str::msg_params][str::initial_prompt][i][str::type];
}
+ // app_id
+ msg_params[strings::app_id] = connection_key();
+ msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
+ awaiting_tts_speak_response_ = true;
+ SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
}
void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
@@ -333,37 +353,16 @@ void PerformAudioPassThruRequest::FinishTTSSpeak() {
LOG4CXX_DEBUG(logger_, "Stop AudioPassThru.");
application_manager_.StopAudioPassThru(connection_key());
}
- if (!is_active_tts_speak_) {
+ if (!awaiting_tts_speak_response_) {
LOG4CXX_WARN(logger_, "TTS Speak is inactive.");
return;
}
- is_active_tts_speak_ = false;
SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL);
}
-bool PerformAudioPassThruRequest::WaitTTSSpeak() {
+bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
LOG4CXX_AUTO_TRACE(logger_);
- uint64_t default_timeout_msec =
- application_manager_.get_settings().default_timeout();
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
-
- // Waiting for TTS_Speak
- while (is_active_tts_speak_) {
- uint64_t difference_between_start_current_time =
- date_time::DateTime::calculateTimeSpan(start_time);
- // Send GENERIC_ERROR after default timeout
- if (difference_between_start_current_time > default_timeout_msec) {
- LOG4CXX_WARN(logger_, "Expired timeout for TTS.Speak response");
- // Don't use onTimeOut(), because default_timeout_ is bigger than
- // Default time in *.ini file
- FinishTTSSpeak();
- SendResponse(false,
- mobile_apis::Result::eType::GENERIC_ERROR,
- "Expired timeout for TTS.Speak response");
- return false;
- }
- }
- return true;
+ return awaiting_tts_speak_response_ || awaiting_ui_response_;
}
} // 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 39ad51e822..007440e8e6 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
@@ -57,13 +57,11 @@ PerformInteractionRequest::PerformInteractionRequest(
const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager)
, interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM)
- , ui_response_recived_(false)
- , vr_response_recived_(false)
- , ui_result_(false)
- , vr_result_(false)
+ , ui_response_received_(false)
+ , vr_response_received_(false)
, app_pi_was_active_before_(false)
- , vr_resultCode_(mobile_apis::Result::INVALID_ENUM)
- , ui_resultCode_(mobile_apis::Result::INVALID_ENUM) {
+ , vr_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
+ , ui_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand);
subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress);
@@ -207,6 +205,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);
@@ -228,22 +227,24 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::UI_PerformInteraction: {
LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event");
- ui_response_recived_ = true;
+ ui_response_received_ = true;
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- ui_resultCode_ =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
- ProcessPerformInteractionResponse(event.smart_object(), msg_param);
+ ui_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, ui_info_);
+ ProcessUIResponse(event.smart_object(), msg_param);
break;
}
case hmi_apis::FunctionID::VR_PerformInteraction: {
LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction");
- vr_response_recived_ = true;
+ vr_response_received_ = true;
unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction);
- vr_resultCode_ =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
- ProcessVRResponse(event.smart_object(), msg_param);
+ vr_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, vr_info_);
+ if (ProcessVRResponse(event.smart_object(), msg_param)) {
+ return;
+ }
break;
}
default: {
@@ -252,8 +253,7 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) {
}
}
- if (mobile_apis::InteractionMode::BOTH == interaction_mode_ &&
- !HasHMIResponsesToWait()) {
+ if (!HasHMIResponsesToWait()) {
LOG4CXX_DEBUG(logger_, "Send response in BOTH iteraction mode");
SendBothModeResponse(msg_param);
}
@@ -264,7 +264,8 @@ void PerformInteractionRequest::onTimeOut() {
switch (interaction_mode_) {
case mobile_apis::InteractionMode::BOTH: {
- if (true == vr_response_recived_) {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
+ if (true == vr_response_received_) {
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
DisablePerformInteraction();
CommandRequestImpl::onTimeOut();
@@ -275,11 +276,14 @@ void PerformInteractionRequest::onTimeOut() {
break;
}
case mobile_apis::InteractionMode::VR_ONLY: {
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
break;
}
case mobile_apis::InteractionMode::MANUAL_ONLY: {
+ LOG4CXX_DEBUG(logger_, "InteractionMode: MANUAL_ONLY");
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
DisablePerformInteraction();
CommandRequestImpl::onTimeOut();
@@ -292,12 +296,12 @@ void PerformInteractionRequest::onTimeOut() {
};
}
-void PerformInteractionRequest::ProcessVRResponse(
+bool PerformInteractionRequest::ProcessVRResponse(
const smart_objects::SmartObject& message,
smart_objects::SmartObject& msg_params) {
LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
using namespace mobile_apis;
- using namespace mobile_apis::Result;
using namespace smart_objects;
using namespace helpers;
@@ -305,37 +309,36 @@ void PerformInteractionRequest::ProcessVRResponse(
if (!app) {
LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
+ return false;
}
- CheckResponseResultCode();
msg_params[strings::trigger_source] =
static_cast<int32_t>(TriggerSource::TS_VR);
- const bool is_vr_aborted_timeout =
- Compare<Result::eType, EQ, ONE>(vr_resultCode_, ABORTED, TIMED_OUT);
+ const bool is_vr_aborted_timeout = Compare<Common_Result::eType, EQ, ONE>(
+ vr_result_code_, Common_Result::ABORTED, Common_Result::TIMED_OUT);
if (is_vr_aborted_timeout) {
LOG4CXX_DEBUG(logger_, "VR response aborted");
if (InteractionMode::VR_ONLY == interaction_mode_) {
LOG4CXX_DEBUG(logger_, "Aborted or Timeout Send Close Popup");
TerminatePerformInteraction();
- SendResponse(false, vr_resultCode_);
- return;
+ SendResponse(false, MessageHelper::HMIToMobileResult(vr_result_code_));
+ return true;
}
LOG4CXX_DEBUG(logger_, "Update timeout for UI");
application_manager_.updateRequestTimeout(
connection_key(), correlation_id(), default_timeout());
- return;
+ return false;
}
- if (SUCCESS == vr_resultCode_ &&
+ if (Common_Result::SUCCESS == vr_result_code_ &&
InteractionMode::MANUAL_ONLY == interaction_mode_) {
LOG4CXX_DEBUG(logger_,
"VR response SUCCESS in MANUAL_ONLY mode "
<< "Wait for UI response");
// in case MANUAL_ONLY mode VR.PI SUCCESS just return
- return;
+ return false;
}
const SmartObject& hmi_msg_params = message[strings::msg_params];
@@ -345,26 +348,15 @@ void PerformInteractionRequest::ProcessVRResponse(
LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
TerminatePerformInteraction();
SendResponse(
- false, GENERIC_ERROR, "Wrong choiceID was received from HMI");
- return;
+ false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI");
+ return true;
}
msg_params[strings::choice_id] = choise_id;
}
-
- vr_result_ = true;
-
- if (mobile_apis::InteractionMode::BOTH == interaction_mode_ &&
- mobile_apis::Result::SUCCESS != vr_resultCode_) {
- LOG4CXX_DEBUG(logger_, "VR response isn't SUCCESS in BOTH mode");
- return;
- }
-
- LOG4CXX_DEBUG(logger_, "VR response consider to be SUCCESS");
- TerminatePerformInteraction();
- SendResponse(vr_result_, SUCCESS, NULL, &msg_params);
+ return false;
}
-void PerformInteractionRequest::ProcessPerformInteractionResponse(
+void PerformInteractionRequest::ProcessUIResponse(
const smart_objects::SmartObject& message,
smart_objects::SmartObject& msg_params) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -377,31 +369,37 @@ void PerformInteractionRequest::ProcessPerformInteractionResponse(
return;
}
- ui_result_ = Compare<mobile_api::Result::eType, EQ, ONE>(
- ui_resultCode_,
- mobile_apis::Result::SUCCESS,
- mobile_apis::Result::WARNINGS,
- mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
+ bool result = false;
+ result = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS);
- const bool is_pi_warning = Compare<mobile_api::Result::eType, EQ, ONE>(
- ui_resultCode_, mobile_apis::Result::WARNINGS);
+ result = result ||
+ (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_code_ &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state);
- const bool is_pi_unsupported = Compare<mobile_api::Result::eType, EQ, ONE>(
- ui_resultCode_, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ const bool is_pi_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_, hmi_apis::Common_Result::WARNINGS);
- std::string info;
+ const bool is_pi_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_, hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
- if (ui_result_) {
+ if (result) {
if (is_pi_warning) {
- ui_resultCode_ = mobile_apis::Result::WARNINGS;
- info = "Unsupported phoneme type was sent in an item";
+ ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
+ ui_info_ = "Unsupported phoneme type was sent in an item";
if (message.keyExists(strings::params) &&
message[strings::params].keyExists(strings::data)) {
msg_params = message[strings::params][strings::data];
}
} else if (is_pi_unsupported) {
- ui_resultCode_ = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- info = "Unsupported phoneme type was sent in an item";
+ ui_result_code_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ ui_info_ = "Unsupported phoneme type was sent in an item";
} else if (message.keyExists(strings::msg_params)) {
msg_params = message[strings::msg_params];
}
@@ -409,8 +407,8 @@ void PerformInteractionRequest::ProcessPerformInteractionResponse(
if (msg_params.keyExists(strings::choice_id)) {
if (!CheckChoiceIDFromResponse(app,
msg_params[strings::choice_id].asInt())) {
- ui_resultCode_ = mobile_apis::Result::GENERIC_ERROR;
- info = "Wrong choiceID was received from HMI";
+ ui_result_code_ = hmi_apis::Common_Result::GENERIC_ERROR;
+ ui_info_ = "Wrong choiceID was received from HMI";
} else {
msg_params[strings::trigger_source] =
mobile_apis::TriggerSource::TS_MENU;
@@ -423,15 +421,6 @@ void PerformInteractionRequest::ProcessPerformInteractionResponse(
}
}
}
-
- DisablePerformInteraction();
-
- const SmartObject* response_params = msg_params.empty() ? NULL : &msg_params;
-
- if (mobile_apis::InteractionMode::BOTH != interaction_mode_) {
- DisablePerformInteraction();
- SendResponse(ui_result_, ui_resultCode_, info.c_str(), response_params);
- }
}
void PerformInteractionRequest::SendUIPerformInteractionRequest(
@@ -929,60 +918,31 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest(
const bool PerformInteractionRequest::HasHMIResponsesToWait() const {
LOG4CXX_AUTO_TRACE(logger_);
- return !ui_response_recived_ || !vr_response_recived_;
-}
-
-void PerformInteractionRequest::CheckResponseResultCode() {
- LOG4CXX_AUTO_TRACE(logger_);
- mobile_apis::Result::eType resultCode = mobile_apis::Result::INVALID_ENUM;
- bool result = false;
- if (mobile_apis::Result::GENERIC_ERROR == vr_resultCode_) {
- LOG4CXX_DEBUG(logger_, "VR response GENERIC_ERROR");
- resultCode = mobile_apis::Result::GENERIC_ERROR;
- } else if (mobile_apis::Result::REJECTED == vr_resultCode_) {
- LOG4CXX_DEBUG(logger_, "VR had been rejected.");
- resultCode = mobile_apis::Result::REJECTED;
- } else if (mobile_apis::Result::WARNINGS == vr_resultCode_ ||
- mobile_apis::Result::UNSUPPORTED_REQUEST == vr_resultCode_) {
- LOG4CXX_DEBUG(logger_, "VR response WARNINGS");
- resultCode = mobile_api::Result::WARNINGS;
- result = true;
- }
-
- if (mobile_apis::Result::INVALID_ENUM != resultCode) {
- TerminatePerformInteraction();
- SendResponse(result, resultCode);
- }
+ return !ui_response_received_ || !vr_response_received_;
}
void PerformInteractionRequest::SendBothModeResponse(
const smart_objects::SmartObject& msg_param) {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace mobile_apis::Result;
-
- bool result = ui_result_ || vr_result_;
- mobile_apis::Result::eType perform_interaction_result_code = ui_resultCode_;
-
- if (UNSUPPORTED_RESOURCE == vr_resultCode_ &&
- UNSUPPORTED_RESOURCE != ui_resultCode_) {
- perform_interaction_result_code = vr_resultCode_;
- } else if (UNSUPPORTED_RESOURCE == vr_resultCode_ &&
- UNSUPPORTED_RESOURCE == ui_resultCode_) {
- result = false;
- }
-
- const bool is_error_code = (SUCCESS != perform_interaction_result_code ||
- WARNINGS != perform_interaction_result_code);
-
- if (vr_resultCode_ == ui_resultCode_ && is_error_code) {
- result = false;
- }
-
+ 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);
+ const bool result =
+ PrepareResultForMobileResponse(ui_perform_info, vr_perform_info);
+ perform_interaction_result_code =
+ PrepareResultCodeForResponse(ui_perform_info, vr_perform_info);
const smart_objects::SmartObject* response_params =
msg_param.empty() ? NULL : &msg_param;
-
- TerminatePerformInteraction();
- SendResponse(result, perform_interaction_result_code, NULL, response_params);
+ std::string info =
+ MergeInfos(ui_perform_info, ui_info_, vr_perform_info, vr_info_);
+ DisablePerformInteraction();
+ SendResponse(result,
+ perform_interaction_result_code,
+ info.empty() ? NULL : info.c_str(),
+ response_params);
}
} // namespace commands
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 69885f9d40..0bf747bde3 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
@@ -36,6 +36,7 @@
#include "application_manager/application_impl.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -65,7 +66,7 @@ void ReadDIDRequest::Run() {
return;
}
- if (app->IsCommandLimitsExceeded(
+ if (app->AreCommandLimitsExceeded(
static_cast<mobile_apis::FunctionID::eType>(function_id()),
application_manager::TLimitSource::CONFIG_FILE)) {
LOG4CXX_ERROR(logger_, "ReadDID frequency is too high.");
@@ -96,18 +97,17 @@ void ReadDIDRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- bool result = mobile_apis::Result::SUCCESS == result_code;
-
- const std::string return_info =
- message[strings::msg_params][hmi_response::message].asString();
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
SendResponse(result,
- result_code,
- return_info.c_str(),
+ MessageHelper::HMIToMobileResult(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/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
index e9f6db05b2..413aa1f669 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
@@ -42,8 +42,11 @@
#include "application_manager/application_manager.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_impl.h"
+#include "application_manager/app_launch/app_launch_ctrl.h"
#include "application_manager/message_helper.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "config_profile/profile.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/generated_msg_version.h"
@@ -139,6 +142,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 {
@@ -363,61 +373,40 @@ RegisterAppInterfaceRequest::GetLockScreenIconUrlNotification(
return message;
}
-void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
-
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
-
- const uint32_t key = connection_key();
- ApplicationSharedPtr application = application_manager_.application(key);
-
- resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
+void FillVRRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ response_params[strings::language] = hmi_capabilities.active_vr_language();
+ if (hmi_capabilities.vr_capabilities()) {
+ response_params[strings::vr_capabilities] =
+ *hmi_capabilities.vr_capabilities();
+ }
+}
- if (!application) {
- LOG4CXX_ERROR(logger_,
- "There is no application for such connection key" << key);
- LOG4CXX_DEBUG(logger_, "Need to start resume data persistent timer");
- resumer.OnAppRegistrationEnd();
- return;
+void FillVIRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ if (hmi_capabilities.vehicle_type()) {
+ response_params[hmi_response::vehicle_type] =
+ *hmi_capabilities.vehicle_type();
}
+}
- response_params[strings::sync_msg_version][strings::major_version] =
- major_version; // From generated file interfaces/generated_msg_version.h
- response_params[strings::sync_msg_version][strings::minor_version] =
- minor_version; // From generated file interfaces/generated_msg_version.h
+void FillTTSRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ response_params[strings::language] = hmi_capabilities.active_tts_language();
+ if (hmi_capabilities.speech_capabilities()) {
+ response_params[strings::speech_capabilities] =
+ *hmi_capabilities.speech_capabilities();
+ }
+ if (hmi_capabilities.prerecorded_speech()) {
+ response_params[strings::prerecorded_speech] =
+ *(hmi_capabilities.prerecorded_speech());
+ }
+}
- response_params[strings::language] = hmi_capabilities.active_vr_language();
+void FillUIRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
response_params[strings::hmi_display_language] =
hmi_capabilities.active_ui_language();
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- if (msg_params[strings::language_desired].asInt() !=
- hmi_capabilities.active_vr_language() ||
- msg_params[strings::hmi_display_language_desired].asInt() !=
- hmi_capabilities.active_ui_language()) {
- LOG4CXX_WARN(logger_,
- "Wrong language on registering application "
- << application->name().c_str());
-
- LOG4CXX_ERROR(
- logger_,
- "VR language desired code is "
- << msg_params[strings::language_desired].asInt()
- << " , active VR language code is "
- << hmi_capabilities.active_vr_language() << ", UI language code is "
- << msg_params[strings::hmi_display_language_desired].asInt()
- << " , active UI language code is "
- << hmi_capabilities.active_ui_language());
-
- result_code = mobile_apis::Result::WRONG_LANGUAGE;
- }
-
if (hmi_capabilities.display_capabilities()) {
response_params[hmi_response::display_capabilities] =
smart_objects::SmartObject(smart_objects::SmartType_Map);
@@ -453,13 +442,10 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
hmi_capabilities.display_capabilities()->getElement(
hmi_response::num_custom_presets_available);
- if (hmi_capabilities.display_capabilities()
- ->getElement(hmi_response::image_capabilities)
- .length() > 0) {
- display_caps[hmi_response::graphic_supported] = true;
- } else {
- display_caps[hmi_response::graphic_supported] = false;
- }
+ display_caps[hmi_response::graphic_supported] =
+ (hmi_capabilities.display_capabilities()
+ ->getElement(hmi_response::image_capabilities)
+ .length() > 0);
display_caps[hmi_response::templates_available] =
hmi_capabilities.display_capabilities()->getElement(
@@ -474,6 +460,96 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
hmi_response::num_custom_presets_available);
}
+ if (hmi_capabilities.audio_pass_thru_capabilities()) {
+ if (smart_objects::SmartType_Array ==
+ hmi_capabilities.audio_pass_thru_capabilities()->getType()) {
+ // hmi_capabilities json contains array and HMI response object
+ response_params[strings::audio_pass_thru_capabilities] =
+ *hmi_capabilities.audio_pass_thru_capabilities();
+ } else {
+ response_params[strings::audio_pass_thru_capabilities][0] =
+ *hmi_capabilities.audio_pass_thru_capabilities();
+ }
+ }
+ response_params[strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ response_params[strings::hmi_capabilities][strings::navigation] =
+ hmi_capabilities.navigation_supported();
+ response_params[strings::hmi_capabilities][strings::phone_call] =
+ hmi_capabilities.phone_call_supported();
+}
+
+void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
+
+ const HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+
+ const uint32_t key = connection_key();
+ ApplicationSharedPtr application = application_manager_.application(key);
+
+ resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_,
+ "There is no application for such connection key" << key);
+ LOG4CXX_DEBUG(logger_, "Need to start resume data persistent timer");
+ resumer.OnAppRegistrationEnd();
+ return;
+ }
+
+ response_params[strings::sync_msg_version][strings::major_version] =
+ major_version; // From generated file interfaces/generated_msg_version.h
+ response_params[strings::sync_msg_version][strings::minor_version] =
+ minor_version; // From generated file interfaces/generated_msg_version.h
+ response_params[strings::sync_msg_version][strings::patch_version] =
+ patch_version; // From generated file interfaces/generated_msg_version.h
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params[strings::language_desired].asInt() !=
+ hmi_capabilities.active_vr_language() ||
+ msg_params[strings::hmi_display_language_desired].asInt() !=
+ hmi_capabilities.active_ui_language()) {
+ LOG4CXX_WARN(logger_,
+ "Wrong language on registering application "
+ << application->name().c_str());
+
+ LOG4CXX_ERROR(
+ logger_,
+ "VR language desired code is "
+ << msg_params[strings::language_desired].asInt()
+ << " , active VR language code is "
+ << hmi_capabilities.active_vr_language() << ", UI language code is "
+ << msg_params[strings::hmi_display_language_desired].asInt()
+ << " , active UI language code is "
+ << hmi_capabilities.active_ui_language());
+
+ result_code = mobile_apis::Result::WRONG_LANGUAGE;
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS)) {
+ FillTTSRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VR)) {
+ FillVRRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI)) {
+ FillUIRelatedFields(response_params, hmi_capabilities);
+ }
+
if (hmi_capabilities.button_capabilities()) {
response_params[hmi_response::button_capabilities] =
*hmi_capabilities.button_capabilities();
@@ -497,36 +573,22 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
*hmi_capabilities.hmi_zone_capabilities();
}
}
- if (hmi_capabilities.speech_capabilities()) {
- response_params[strings::speech_capabilities] =
- *hmi_capabilities.speech_capabilities();
- }
- if (hmi_capabilities.vr_capabilities()) {
- response_params[strings::vr_capabilities] =
- *hmi_capabilities.vr_capabilities();
- }
- if (hmi_capabilities.audio_pass_thru_capabilities()) {
- if (smart_objects::SmartType_Array ==
- hmi_capabilities.audio_pass_thru_capabilities()->getType()) {
- // hmi_capabilities json contains array and HMI response object
- response_params[strings::audio_pass_thru_capabilities] =
- *hmi_capabilities.audio_pass_thru_capabilities();
- } else {
- response_params[strings::audio_pass_thru_capabilities][0] =
- *hmi_capabilities.audio_pass_thru_capabilities();
- }
+
+ 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 (hmi_capabilities.vehicle_type()) {
- response_params[hmi_response::vehicle_type] =
- *hmi_capabilities.vehicle_type();
- }
- if (hmi_capabilities.prerecorded_speech()) {
- response_params[strings::prerecorded_speech] =
- *(hmi_capabilities.prerecorded_speech());
+
+ 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 =
@@ -539,13 +601,6 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
++index;
}
}
-
- response_params[strings::hmi_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- response_params[strings::hmi_capabilities][strings::navigation] =
- hmi_capabilities.navigation_supported();
- response_params[strings::hmi_capabilities][strings::phone_call] =
- hmi_capabilities.phone_call_supported();
response_params[strings::sdl_version] =
application_manager_.get_settings().sdl_version();
const std::string ccpu_version =
@@ -590,31 +645,78 @@ 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);
- SendResponse(true, result_code, add_info.c_str(), &response_params);
- // Check if application exists, because application might be unregestered
- // during sending reponse to mobile.
- application = application_manager_.application(key);
- if (application) {
- LOG4CXX_DEBUG(logger_, "Application with app_id = " << key << " exists.");
- if (result_code != mobile_apis::Result::RESUME_FAILED) {
- resumer.StartResumption(application, hash_id);
- } else {
- resumer.StartResumptionOnlyHMILevel(application);
- }
+ // Default HMI level should be set before any permissions validation, since it
+ // relies on HMI level.
+ application_manager_.OnApplicationRegistered(application);
+ (*notify_upd_manager)();
- // By default app subscribed to CUSTOM_BUTTON
- SendSubscribeCustomButtonNotification();
- MessageHelper::SendChangeRegistrationRequestToHMI(application,
- application_manager_);
+ // Start PTU after successfull registration
+ // Sends OnPermissionChange notification to mobile right after RAI response
+ // and HMI level set-up
+ GetPolicyHandler().OnAppRegisteredOnMobile(application->policy_app_id());
+
+ if (result_code != mobile_apis::Result::RESUME_FAILED) {
+ resumer.StartResumption(application, hash_id);
} else {
- LOG4CXX_DEBUG(logger_,
- "Application with app_id = " << key << " doesn't exist.");
+ resumer.StartResumptionOnlyHMILevel(application);
+ }
+
+ // By default app subscribed to CUSTOM_BUTTON
+ SendSubscribeCustomButtonNotification();
+ SendChangeRegistrationOnHMI(application);
+}
+
+void RegisterAppInterfaceRequest::SendChangeRegistration(
+ const hmi_apis::FunctionID::eType function_id,
+ const int32_t language,
+ const uint32_t app_id) {
+ using helpers::Compare;
+ using helpers::EQ;
+ using helpers::ONE;
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ const HmiInterfaces::InterfaceID interface =
+ hmi_interfaces.GetInterfaceFromFunction(function_id);
+ if (hmi_interfaces.GetInterfaceState(interface) !=
+ HmiInterfaces::STATE_NOT_AVAILABLE) {
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[strings::language] = language;
+ msg_params[strings::app_id] = app_id;
+ SendHMIRequest(function_id, &msg_params);
+ } else {
+ LOG4CXX_DEBUG(logger_, "Interface " << interface << "is not avaliable");
}
}
+void RegisterAppInterfaceRequest::SendChangeRegistrationOnHMI(
+ ApplicationConstSharedPtr app) {
+ using namespace hmi_apis::FunctionID;
+ DCHECK_OR_RETURN_VOID(app);
+ DCHECK_OR_RETURN_VOID(mobile_apis::Language::INVALID_ENUM != app->language());
+ SendChangeRegistration(VR_ChangeRegistration, app->language(), app->app_id());
+ SendChangeRegistration(
+ TTS_ChangeRegistration, app->language(), app->app_id());
+ SendChangeRegistration(UI_ChangeRegistration, app->language(), app->app_id());
+}
+
void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
const Application& application_impl,
bool resumption,
@@ -819,7 +921,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());
@@ -829,13 +931,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);
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 0260fef676..b1dce9151f 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
@@ -251,6 +251,7 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
break;
}
case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
@@ -258,6 +259,7 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
is_tts_received_ = true;
tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
break;
}
default: {
@@ -266,48 +268,63 @@ 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 = "Unsupported phoneme type sent in a prompt";
- } 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();
- }
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (result) {
+ application->UpdateHash();
+ }
+}
+
+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);
+ ResponseInfo tts_properties_info(tts_result_,
+ HmiInterfaces::HMI_INTERFACE_TTS);
+
+ 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() {
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 89bd43fcd6..0c770953fe 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
@@ -115,7 +115,6 @@ void ScrollableMessageRequest::Run() {
void ScrollableMessageRequest::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()) {
@@ -128,24 +127,19 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::UI_ScrollableMessage: {
LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event");
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
- bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::SUCCESS,
- mobile_api::Result::WARNINGS);
-
- if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code &&
- hmi_capabilities.is_ui_cooperating()) {
- result = true;
- }
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
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 975f7e43c3..9ec4ca3fcc 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
@@ -31,11 +31,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
#include <algorithm>
-
#include "application_manager/commands/mobile/send_location_request.h"
-
#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
#include "utils/custom_string.h"
namespace application_manager {
@@ -65,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);
}
}
@@ -136,21 +131,20 @@ void SendLocationRequest::Run() {
void SendLocationRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
- namespace Result = mobile_apis::Result;
- using namespace helpers;
+ using namespace hmi_apis;
const smart_objects::SmartObject& message = event.smart_object();
if (hmi_apis::FunctionID::Navigation_SendLocation == event.id()) {
LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event");
- 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<Result::eType, EQ, ONE>(result_code,
- Result::SAVED,
- Result::SUCCESS,
- Result::WARNINGS,
- Result::UNSUPPORTED_RESOURCE);
- SendResponse(result, result_code, NULL, &(message[strings::params]));
+ const Common_Result::eType result_code = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::params]));
return;
}
LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
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 40b708e30d..5d70a2fb5b 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
@@ -34,6 +34,7 @@
#include <algorithm>
#include "application_manager/commands/mobile/set_app_icon_request.h"
+#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
@@ -229,20 +230,17 @@ bool SetAppIconRequest::IsEnoughSpaceForIcon(const uint64_t icon_size) const {
void SetAppIconRequest::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_SetAppIcon: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::SUCCESS,
- mobile_api::Result::WARNINGS);
-
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string response_info;
+ GetInfo(message, response_info);
if (result) {
ApplicationSharedPtr app =
application_manager_.application(connection_key());
@@ -261,7 +259,10 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) {
"Icon path was set to '" << app->app_icon_path() << "'");
}
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
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 6cb6318791..984690384a 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
@@ -33,6 +33,7 @@
#include "application_manager/commands/mobile/set_display_layout_request.h"
+#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
namespace application_manager {
@@ -69,14 +70,14 @@ 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");
-
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
- bool response_success = mobile_apis::Result::SUCCESS == result_code;
-
+ const bool response_success = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string info;
+ GetInfo(message, info);
smart_objects::SmartObject msg_params = message[strings::msg_params];
-
if (response_success) {
HMICapabilities& hmi_capabilities =
application_manager_.hmi_capabilities();
@@ -93,7 +94,10 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
}
}
}
- SendResponse(response_success, result_code, NULL, &msg_params);
+ SendResponse(response_success,
+ MessageHelper::HMIToMobileResult(result_code),
+ info.empty() ? NULL : info.c_str(),
+ &msg_params);
break;
}
default: {
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 171b902df1..fcfea5e744 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
@@ -127,6 +127,12 @@ void SetGlobalPropertiesRequest::Run() {
SendResponse(false, mobile_apis::Result::REJECTED);
return;
}
+
+ /* Need to set flags before sending request to HMI
+ * for correct processing this flags in method on_event */
+ if (is_help_prompt_present || is_timeout_prompt_present) {
+ is_tts_send_ = true;
+ }
if (is_vr_help_title_present && is_vr_help_present) {
LOG4CXX_DEBUG(logger_, "VRHelp params presents");
@@ -226,6 +232,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
break;
}
case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
@@ -233,6 +240,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
is_tts_received_ = true;
tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
break;
}
default: {
@@ -245,54 +253,18 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
LOG4CXX_DEBUG(logger_, "Continue waiting for response");
return;
}
-
- const bool is_tts_succeeded =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- tts_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- hmi_apis::Common_Result::WARNINGS);
-
- const bool is_ui_succeeded = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- hmi_apis::Common_Result::WARNINGS);
-
- const bool is_ui_invalid_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::INVALID_ENUM,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- bool result = (is_tts_succeeded && is_ui_succeeded) ||
- (is_ui_succeeded &&
- hmi_apis::Common_Result::INVALID_ENUM == tts_result_) ||
- (is_ui_invalid_unsupported && is_tts_succeeded);
-
mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- const char* return_info = NULL;
-
- const bool is_ui_or_tts_warning =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::WARNINGS, tts_result_, ui_result_);
-
- if (result && (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_ ||
- is_ui_or_tts_warning)) {
- result_code = mobile_apis::Result::WARNINGS;
- return_info =
- std::string("Unsupported phoneme type sent in a prompt").c_str();
- } else {
- result_code =
- MessageHelper::HMIToMobileResult(std::max(ui_result_, tts_result_));
- }
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
// TODO{ALeshin} APPLINK-15858. connection_key removed during SendResponse
ApplicationSharedPtr application =
application_manager_.application(connection_key());
- SendResponse(
- result, result_code, return_info, &(message[strings::msg_params]));
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
if (!application) {
LOG4CXX_DEBUG(logger_, "NULL pointer.");
@@ -304,6 +276,37 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
}
}
+bool SetGlobalPropertiesRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ ResponseInfo ui_properties_info(ui_result_, HmiInterfaces::HMI_INTERFACE_UI);
+
+ ResponseInfo tts_properties_info(tts_result_,
+ HmiInterfaces::HMI_INTERFACE_TTS);
+ const bool result =
+ PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
+ if (result &&
+ (HmiInterfaces::STATE_AVAILABLE == tts_properties_info.interface_state) &&
+ (tts_properties_info.is_unsupported_resource)) {
+ result_code = mobile_apis::Result::WARNINGS;
+ tts_response_info_ = "Unsupported phoneme type sent in a prompt";
+ info = MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
+ return result;
+ }
+ result_code =
+ PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
+ info = MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
+ return result;
+}
+
bool SetGlobalPropertiesRequest::ValidateVRHelpTitle(
const smart_objects::SmartObject* const vr_help_so_ptr) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -397,17 +400,17 @@ void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData(
void SetGlobalPropertiesRequest::SendTTSRequest(
const smart_objects::SmartObject& params, bool use_events) {
LOG4CXX_AUTO_TRACE(logger_);
+ is_tts_send_ = true;
SendHMIRequest(
hmi_apis::FunctionID::TTS_SetGlobalProperties, &params, use_events);
- is_tts_send_ = true;
}
void SetGlobalPropertiesRequest::SendUIRequest(
const smart_objects::SmartObject& params, bool use_events) {
LOG4CXX_AUTO_TRACE(logger_);
+ is_ui_send_ = true;
SendHMIRequest(
hmi_apis::FunctionID::UI_SetGlobalProperties, &params, use_events);
- is_ui_send_ = true;
}
bool SetGlobalPropertiesRequest::IsPendingResponseExist() {
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 a198ce63c3..1e0a00318d 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
@@ -33,6 +33,7 @@
#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
+#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
@@ -84,13 +85,18 @@ void SetMediaClockRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- bool result = mobile_apis::Result::SUCCESS == result_code;
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
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 2d79e13582..b1cc40009d 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
@@ -178,31 +178,22 @@ void ShowConstantTBTRequest::Run() {
void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event");
- std::string return_info;
-
- mobile_apis::Result::eType result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt()));
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- bool result = false;
- if (mobile_apis::Result::SUCCESS == result_code) {
- result = true;
- return_info =
- message[strings::msg_params][hmi_response::message].asString();
- } else if ((mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) &&
- hmi_capabilities.is_ui_cooperating()) {
- result = true;
- }
-
+ const Common_Result::eType result_code =
+ static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
SendResponse(result,
- result_code,
- return_info.empty() ? 0 : return_info.c_str(),
+ MessageHelper::HMIToMobileResult(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/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc
index 467d8d0236..cf2509cdb9 100644
--- a/src/components/application_manager/src/commands/mobile/show_request.cc
+++ b/src/components/application_manager/src/commands/mobile/show_request.cc
@@ -228,23 +228,19 @@ void ShowRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::UI_Show: {
LOG4CXX_DEBUG(logger_, "Received UI_Show event.");
std::string response_info;
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::SUCCESS,
- mobile_api::Result::WARNINGS);
-
- if (mobile_apis::Result::WARNINGS == result_code &&
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ GetInfo(message, response_info);
+ if (hmi_apis::Common_Result::WARNINGS == result_code &&
message[strings::params].keyExists(hmi_response::message)) {
response_info =
message[strings::params][hmi_response::message].asString();
}
-
SendResponse(result,
- result_code,
+ MessageHelper::HMIToMobileResult(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 3920b49db3..054d0ec16d 100644
--- a/src/components/application_manager/src/commands/mobile/slider_request.cc
+++ b/src/components/application_manager/src/commands/mobile/slider_request.cc
@@ -154,13 +154,14 @@ void SliderRequest::on_event(const event_engine::Event& event) {
response_msg_params[strings::slider_position] = 0;
}
}
-
- const bool is_response_success = Compare<Common_Result::eType, EQ, ONE>(
- response_code, Common_Result::SUCCESS, Common_Result::WARNINGS);
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool is_response_success = PrepareResultForMobileResponse(
+ response_code, HmiInterfaces::HMI_INTERFACE_UI);
SendResponse(is_response_success,
MessageHelper::HMIToMobileResult(response_code),
- 0,
+ response_info.empty() ? NULL : response_info.c_str(),
&response_msg_params);
}
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 01db47909b..6cbb762102 100644
--- a/src/components/application_manager/src/commands/mobile/speak_request.cc
+++ b/src/components/application_manager/src/commands/mobile/speak_request.cc
@@ -120,24 +120,14 @@ void SpeakRequest::ProcessTTSSpeakResponse(
mobile_apis::Result::eType result_code =
MessageHelper::HMIToMobileResult(hmi_result_code);
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code, mobile_api::Result::SUCCESS, mobile_api::Result::WARNINGS);
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result_code, HmiInterfaces::HMI_INTERFACE_TTS);
(*message_)[strings::params][strings::function_id] =
mobile_apis::FunctionID::SpeakID;
const char* return_info = NULL;
- const bool is_result_ok = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::UNSUPPORTED_RESOURCE,
- mobile_api::Result::WARNINGS);
-
- if (is_result_ok) {
- result_code = mobile_apis::Result::WARNINGS;
- return_info = "Unsupported phoneme type sent in a prompt";
- }
-
SendResponse(
result, result_code, return_info, &(message[strings::msg_params]));
}
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 7ec4e20fbd..eb6bbf545e 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
@@ -58,7 +58,7 @@ void SubscribeButtonRequest::Run() {
const mobile_apis::ButtonName::eType btn_id =
static_cast<mobile_apis::ButtonName::eType>(
- (*message_)[str::msg_params][str::button_name].asUInt());
+ (*message_)[str::msg_params][str::button_name].asInt());
if (!IsSubscriptionAllowed(app, btn_id)) {
LOG4CXX_ERROR(logger_,
@@ -101,7 +101,6 @@ bool SubscribeButtonRequest::IsSubscriptionAllowed(
(mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
return false;
}
-
return true;
}
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 485c5d0009..56027bacaf 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
@@ -109,115 +109,21 @@ void SubscribeVehicleDataRequest::Run() {
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return;
}
-
- // counter for items to subscribe
- int32_t items_to_subscribe = 0;
- // counter for subscribed items by application
- int32_t subscribed_items = 0;
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
+ std::string info;
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
-
smart_objects::SmartObject response_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- for (; vehicle_data.end() != it; ++it) {
- const std::string& key_name = it->first;
- if ((*message_)[strings::msg_params].keyExists(key_name)) {
- bool is_key_enabled = (*message_)[strings::msg_params][key_name].asBool();
- if (is_key_enabled) {
- ++items_to_subscribe;
-
- VehicleDataType key_type = it->second;
- if (app->IsSubscribedToIVI(key_type)) {
- LOG4CXX_DEBUG(logger_,
- "App with connection key "
- << connection_key()
- << " is subscribed already for VehicleDataType: "
- << key_type);
- ++subscribed_items;
- vi_already_subscribed_by_this_app_.insert(key_type);
- response_params[key_name][strings::data_type] = key_type;
- response_params[key_name][strings::result_code] =
- mobile_apis::VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
- continue;
- }
-
- if (IsSomeoneSubscribedFor(key_type)) {
- LOG4CXX_DEBUG(logger_,
- "There are apps subscribed already for "
- "VehicleDataType: "
- << key_type);
- if (!app->SubscribeToIVI(static_cast<uint32_t>(key_type))) {
- LOG4CXX_ERROR(
- logger_,
- "Unable to subscribe for VehicleDataType: " << key_type);
- continue;
- }
- LOG4CXX_DEBUG(
- logger_,
- "App with connection key "
- << connection_key()
- << " have been subscribed for VehicleDataType: " << key_type);
- ++subscribed_items;
- vi_already_subscribed_by_another_apps_.insert(key_type);
- response_params[key_name][strings::data_type] = key_type;
- response_params[key_name][strings::result_code] =
- mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
- continue;
- }
-
- msg_params[key_name] = is_key_enabled;
-
- if (app->SubscribeToIVI(static_cast<uint32_t>(key_type))) {
- LOG4CXX_DEBUG(
- logger_,
- "App with connection key "
- << connection_key()
- << " have been subscribed for VehicleDataType: " << key_type);
- ++subscribed_items;
- }
- }
- }
- }
-
- bool is_everything_already_subscribed =
- static_cast<uint32_t>(items_to_subscribe) ==
- vi_already_subscribed_by_another_apps_.size() +
- vi_already_subscribed_by_this_app_.size();
-
- if (0 == items_to_subscribe) {
- if (HasDisallowedParams()) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- } else {
- SendResponse(
- false, mobile_apis::Result::INVALID_DATA, "No data in the request");
- }
- return;
- }
-
- if (0 == subscribed_items) {
- SendResponse(false,
- mobile_apis::Result::IGNORED,
- "Already subscribed on provided VehicleData.",
- &response_params);
- return;
- }
-
- if (is_everything_already_subscribed) {
- mobile_apis::Result::eType result_code =
- vi_already_subscribed_by_this_app_.size()
- ? mobile_apis::Result::IGNORED
- : mobile_apis::Result::SUCCESS;
-
- const char* info = vi_already_subscribed_by_this_app_.size()
- ? "Already subscribed on some provided VehicleData."
- : NULL;
-
- SendResponse(true, result_code, info, &response_params);
+ bool result = false;
+ CheckVISubscribtions(
+ app, info, result_code, response_params, msg_params, result);
+
+ if (mobile_apis::Result::INVALID_ENUM != result_code) {
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ response_params.empty() ? NULL : &response_params);
return;
}
@@ -325,27 +231,24 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
}
}
#else
+
hmi_apis::Common_Result::eType hmi_result =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- const bool is_result_no_error =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_result,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS);
-
- bool is_succeeded =
- is_result_no_error || !vi_already_subscribed_by_another_apps_.empty();
+ bool is_succeeded = result || !vi_already_subscribed_by_another_apps_.empty();
mobile_apis::Result::eType result_code =
MessageHelper::HMIToMobileResult(hmi_result);
- const char* return_info = NULL;
if (is_succeeded) {
if (!vi_already_subscribed_by_this_app_.empty()) {
result_code = mobile_apis::Result::IGNORED;
- return_info = "Already subscribed on some provided VehicleData.";
+ response_info = "Already subscribed on some provided VehicleData.";
}
}
@@ -357,8 +260,10 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
}
- SendResponse(
- is_succeeded, result_code, return_info, &(message[strings::msg_params]));
+ SendResponse(is_succeeded,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
if (is_succeeded) {
app->UpdateHash();
@@ -429,5 +334,121 @@ bool SubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
return it != accessor.GetData().end();
}
+void SubscribeVehicleDataRequest::CheckVISubscribtions(
+ ApplicationSharedPtr app,
+ std::string& out_info,
+ mobile_apis::Result::eType& out_result_code,
+ smart_objects::SmartObject& out_response_params,
+ smart_objects::SmartObject& out_request_params,
+ bool& out_result) {
+ // counter for items to subscribe
+ VehicleInfoSubscriptions::size_type items_to_subscribe = 0;
+ // counter for subscribed items by application
+ uint32_t subscribed_items = 0;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ HmiInterfaces::InterfaceState interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ const bool is_interface_not_available =
+ interface_state == HmiInterfaces::STATE_NOT_AVAILABLE;
+
+ for (; vehicle_data.end() != it; ++it) {
+ const std::string& key_name = it->first;
+ if ((*message_)[strings::msg_params].keyExists(key_name)) {
+ const bool is_key_enabled =
+ (*message_)[strings::msg_params][key_name].asBool();
+ if (is_key_enabled) {
+ ++items_to_subscribe;
+ }
+ if (!is_interface_not_available && is_key_enabled) {
+ VehicleDataType key_type = it->second;
+ if (app->IsSubscribedToIVI(key_type)) {
+ LOG4CXX_DEBUG(logger_,
+ "App with connection key "
+ << connection_key()
+ << " is subscribed already for VehicleDataType: "
+ << key_type);
+ ++subscribed_items;
+ vi_already_subscribed_by_this_app_.insert(key_type);
+ out_response_params[key_name][strings::data_type] = key_type;
+ out_response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
+ continue;
+ }
+
+ if (IsSomeoneSubscribedFor(key_type)) {
+ LOG4CXX_DEBUG(logger_,
+ "There are apps subscribed already for "
+ "VehicleDataType: "
+ << key_type);
+ if (!app->SubscribeToIVI(static_cast<uint32_t>(key_type))) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Unable to subscribe for VehicleDataType: " << key_type);
+ continue;
+ }
+ LOG4CXX_DEBUG(
+ logger_,
+ "App with connection key "
+ << connection_key()
+ << " have been subscribed for VehicleDataType: " << key_type);
+ ++subscribed_items;
+ vi_already_subscribed_by_another_apps_.insert(key_type);
+ out_response_params[key_name][strings::data_type] = key_type;
+ out_response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
+ continue;
+ }
+
+ out_request_params[key_name] = is_key_enabled;
+
+ if (app->SubscribeToIVI(static_cast<uint32_t>(key_type))) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "App with connection key "
+ << connection_key()
+ << " have been subscribed for VehicleDataType: " << key_type);
+ ++subscribed_items;
+ }
+ }
+ }
+ }
+
+ const bool is_everything_already_subscribed =
+ items_to_subscribe ==
+ vi_already_subscribed_by_another_apps_.size() +
+ vi_already_subscribed_by_this_app_.size();
+
+ if (0 == items_to_subscribe) {
+ if (HasDisallowedParams()) {
+ out_result_code = mobile_apis::Result::DISALLOWED;
+ } else {
+ out_result_code = mobile_apis::Result::INVALID_DATA;
+ out_info = "No data in the request";
+ }
+ out_result = false;
+ }
+
+ if (0 == subscribed_items && !is_interface_not_available) {
+ out_result_code = mobile_apis::Result::IGNORED;
+ out_info = "Already subscribed on provided VehicleData.";
+ out_result = false;
+ }
+
+ if (is_everything_already_subscribed) {
+ out_result_code = vi_already_subscribed_by_this_app_.size()
+ ? mobile_apis::Result::IGNORED
+ : mobile_apis::Result::SUCCESS;
+ if (!(vi_already_subscribed_by_this_app_.empty())) {
+ out_info = "Already subscribed on some provided VehicleData.";
+ }
+ out_result = true;
+ }
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc
index 8134730eee..29cc8e6541 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
@@ -1,5 +1,6 @@
#include "application_manager/application_manager.h"
#include "application_manager/commands/mobile/subscribe_way_points_request.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -47,14 +48,20 @@ 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");
- mobile_apis::Result::eType result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
- bool result = mobile_apis::Result::SUCCESS == result_code;
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
if (result) {
application_manager_.SubscribeAppForWayPoints(app->app_id());
}
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
if (result) {
app->UpdateHash();
}
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..74d25508e0 100644
--- a/src/components/application_manager/src/commands/mobile/system_request.cc
+++ b/src/components/application_manager/src/commands/mobile/system_request.cc
@@ -528,8 +528,8 @@ void SystemRequest::Run() {
}
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);
+ LOG4CXX_DEBUG(logger_, "Binary data required. Invalid data");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
return;
}
LOG4CXX_DEBUG(logger_, "IVSU does not require binary data. Continue");
@@ -578,9 +578,9 @@ 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];
SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_SystemRequest,
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 86df8fabb1..e1bdba61a0 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
@@ -61,22 +61,16 @@ void UnsubscribeButtonRequest::Run() {
const uint32_t btn_id =
(*message_)[str::msg_params][str::button_name].asUInt();
- if (!app->IsSubscribedToButton(
+ if (!app->UnsubscribeFromButton(
static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
LOG4CXX_ERROR(logger_, "App doesn't subscibe to button " << btn_id);
SendResponse(false, mobile_apis::Result::IGNORED);
return;
}
- app->UnsubscribeFromButton(
- static_cast<mobile_apis::ButtonName::eType>(btn_id));
-
SendUnsubscribeButtonNotification();
- const bool is_succedeed = true;
- SendResponse(is_succedeed, mobile_apis::Result::SUCCESS);
- if (is_succedeed) {
- app->UpdateHash();
- }
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ app->UpdateHash();
}
void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
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 4fcc04c7be..9b0c0a673f 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
@@ -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;
}
@@ -315,21 +313,18 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
hmi_apis::Common_Result::eType hmi_result =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
-
- bool is_succeeded = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_result,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS);
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
mobile_apis::Result::eType result_code =
MessageHelper::HMIToMobileResult(hmi_result);
- const char* return_info = NULL;
-
- if (is_succeeded) {
+ if (result) {
if (vi_already_unsubscribed_by_this_app_.size()) {
result_code = mobile_apis::Result::IGNORED;
- return_info = "Some provided VehicleData was not subscribed.";
+ response_info = "Some provided VehicleData was not subscribed.";
}
}
@@ -339,12 +334,14 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
}
- if (is_succeeded) {
+ if (result) {
SetAllowedToTerminate(false);
}
- SendResponse(
- is_succeeded, result_code, return_info, &(message[strings::msg_params]));
- if (is_succeeded) {
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ if (result) {
UpdateHash();
}
#endif // #ifdef HMI_DBUS_API
@@ -401,7 +398,8 @@ void UnsubscribeVehicleDataRequest::UpdateHash() const {
"Application with connection_key = " << connection_key()
<< " doesn't exist.");
}
- application_manager_.TerminateRequest(connection_key(), correlation_id());
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
}
} // namespace commands
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 b19e292025..728209fcf2 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
@@ -1,5 +1,6 @@
#include "application_manager/application_manager.h"
#include "application_manager/commands/mobile/unsubscribe_way_points_request.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -40,14 +41,20 @@ 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");
- mobile_apis::Result::eType result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
- bool result = mobile_apis::Result::SUCCESS == result_code;
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
if (result) {
application_manager_.UnsubscribeAppFromWayPoints(app->app_id());
}
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
if (result) {
app->UpdateHash();
}
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 9b3b221446..becab175e9 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
@@ -155,18 +155,17 @@ void UpdateTurnListRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event");
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
-
- bool result =
- (mobile_apis::Result::SUCCESS == result_code) ||
- ((mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) &&
- (hmi_capabilities.is_ui_cooperating()));
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
break;
}
default: {
diff --git a/src/components/application_manager/src/hmi_capabilities.cc b/src/components/application_manager/src/hmi_capabilities.cc
deleted file mode 100644
index 7535984c16..0000000000
--- a/src/components/application_manager/src/hmi_capabilities.cc
+++ /dev/null
@@ -1,950 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/hmi_capabilities.h"
-
-#include <map>
-
-#include "json/json.h"
-#include "utils/file_system.h"
-#include "interfaces/HMI_API.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/message_helper.h"
-#include "formatters/CFormatterJsonBase.h"
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
-
-namespace application_manager {
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-
-std::map<std::string, hmi_apis::Common_VrCapabilities::eType>
- vr_enum_capabilities = {{"TEXT", hmi_apis::Common_VrCapabilities::VR_TEXT}};
-
-std::map<std::string, hmi_apis::Common_ButtonName::eType> button_enum_name = {
- {"OK", hmi_apis::Common_ButtonName::OK},
- {"SEEKLEFT", hmi_apis::Common_ButtonName::SEEKLEFT},
- {"SEEKRIGHT", hmi_apis::Common_ButtonName::SEEKRIGHT},
- {"TUNEUP", hmi_apis::Common_ButtonName::TUNEUP},
- {"TUNEDOWN", hmi_apis::Common_ButtonName::TUNEDOWN},
- {"PRESET_0", hmi_apis::Common_ButtonName::PRESET_0},
- {"PRESET_1", hmi_apis::Common_ButtonName::PRESET_1},
- {"PRESET_2", hmi_apis::Common_ButtonName::PRESET_2},
- {"PRESET_3", hmi_apis::Common_ButtonName::PRESET_3},
- {"PRESET_4", hmi_apis::Common_ButtonName::PRESET_4},
- {"PRESET_5", hmi_apis::Common_ButtonName::PRESET_5},
- {"PRESET_6", hmi_apis::Common_ButtonName::PRESET_6},
- {"PRESET_7", hmi_apis::Common_ButtonName::PRESET_7},
- {"PRESET_8", hmi_apis::Common_ButtonName::PRESET_8},
- {"PRESET_9", hmi_apis::Common_ButtonName::PRESET_9},
- {"CUSTOM_BUTTON", hmi_apis::Common_ButtonName::CUSTOM_BUTTON},
- {"SEARCH", hmi_apis::Common_ButtonName::SEARCH},
-
-};
-
-std::map<std::string,
- hmi_apis::Common_TextFieldName::eType> text_fields_enum_name = {
- {"mainField1", hmi_apis::Common_TextFieldName::mainField1},
- {"mainField2", hmi_apis::Common_TextFieldName::mainField2},
- {"mainField3", hmi_apis::Common_TextFieldName::mainField3},
- {"mainField4", hmi_apis::Common_TextFieldName::mainField4},
- {"statusBar", hmi_apis::Common_TextFieldName::statusBar},
- {"mediaClock", hmi_apis::Common_TextFieldName::mediaClock},
- {"mediaTrack", hmi_apis::Common_TextFieldName::mediaTrack},
- {"alertText1", hmi_apis::Common_TextFieldName::alertText1},
- {"alertText2", hmi_apis::Common_TextFieldName::alertText2},
- {"alertText3", hmi_apis::Common_TextFieldName::alertText3},
- {"scrollableMessageBody",
- hmi_apis::Common_TextFieldName::scrollableMessageBody},
- {"initialInteractionText",
- hmi_apis::Common_TextFieldName::initialInteractionText},
- {"navigationText1", hmi_apis::Common_TextFieldName::navigationText1},
- {"navigationText2", hmi_apis::Common_TextFieldName::navigationText2},
- {"ETA", hmi_apis::Common_TextFieldName::ETA},
- {"totalDistance", hmi_apis::Common_TextFieldName::totalDistance},
- {"audioPassThruDisplayText1",
- hmi_apis::Common_TextFieldName::audioPassThruDisplayText1},
- {"audioPassThruDisplayText2",
- hmi_apis::Common_TextFieldName::audioPassThruDisplayText2},
- {"sliderHeader", hmi_apis::Common_TextFieldName::sliderHeader},
- {"sliderFooter", hmi_apis::Common_TextFieldName::sliderFooter},
- {"notificationText", hmi_apis::Common_TextFieldName::notificationText},
- {"menuName", hmi_apis::Common_TextFieldName::menuName},
- {"secondaryText", hmi_apis::Common_TextFieldName::secondaryText},
- {"tertiaryText", hmi_apis::Common_TextFieldName::tertiaryText},
- {"timeToDestination", hmi_apis::Common_TextFieldName::timeToDestination},
- {"locationName", hmi_apis::Common_TextFieldName::locationName},
- {"locationDescription",
- hmi_apis::Common_TextFieldName::locationDescription},
- {"addressLines", hmi_apis::Common_TextFieldName::turnText},
- {"turnText", hmi_apis::Common_TextFieldName::addressLines},
- {"phoneNumber", hmi_apis::Common_TextFieldName::phoneNumber},
- {"turnText", hmi_apis::Common_TextFieldName::turnText},
- {"menuTitle", hmi_apis::Common_TextFieldName::menuTitle},
- {"navigationText", hmi_apis::Common_TextFieldName::navigationText},
-};
-
-std::map<std::string, hmi_apis::Common_MediaClockFormat::eType>
- media_clock_enum_name = {
- {"CLOCK1", hmi_apis::Common_MediaClockFormat::CLOCK1},
- {"CLOCK2", hmi_apis::Common_MediaClockFormat::CLOCK2},
- {"CLOCK3", hmi_apis::Common_MediaClockFormat::CLOCK3},
- {"CLOCKTEXT1", hmi_apis::Common_MediaClockFormat::CLOCKTEXT1},
- {"CLOCKTEXT2", hmi_apis::Common_MediaClockFormat::CLOCKTEXT2},
- {"CLOCKTEXT3", hmi_apis::Common_MediaClockFormat::CLOCKTEXT3},
- {"CLOCKTEXT4", hmi_apis::Common_MediaClockFormat::CLOCKTEXT4},
-};
-
-std::map<std::string, hmi_apis::Common_ImageType::eType> image_type_enum = {
- {"STATIC", hmi_apis::Common_ImageType::STATIC},
- {"DYNAMIC", hmi_apis::Common_ImageType::DYNAMIC}};
-
-std::map<std::string, hmi_apis::Common_SamplingRate::eType> sampling_rate_enum =
- {{"RATE_8KHZ", hmi_apis::Common_SamplingRate::RATE_8KHZ},
- {"8KHZ", hmi_apis::Common_SamplingRate::RATE_8KHZ},
- {"RATE_16KHZ", hmi_apis::Common_SamplingRate::RATE_16KHZ},
- {"16KHZ", hmi_apis::Common_SamplingRate::RATE_16KHZ},
- {"RATE_22KHZ", hmi_apis::Common_SamplingRate::RATE_22KHZ},
- {"22KHZ", hmi_apis::Common_SamplingRate::RATE_22KHZ},
- {"RATE_44KHZ", hmi_apis::Common_SamplingRate::RATE_44KHZ},
- {"44KHZ", hmi_apis::Common_SamplingRate::RATE_44KHZ}};
-
-std::map<std::string, hmi_apis::Common_BitsPerSample::eType>
- bit_per_sample_enum = {
- {"RATE_8_BIT", hmi_apis::Common_BitsPerSample::RATE_8_BIT},
- {"8_BIT", hmi_apis::Common_BitsPerSample::RATE_8_BIT},
- {"RATE_16_BIT", hmi_apis::Common_BitsPerSample::RATE_16_BIT},
- {"16_BIT", hmi_apis::Common_BitsPerSample::RATE_16_BIT}};
-
-std::map<std::string, hmi_apis::Common_AudioType::eType> audio_type_enum = {
- {"PCM", hmi_apis::Common_AudioType::PCM}};
-
-std::map<std::string, hmi_apis::Common_HmiZoneCapabilities::eType>
- hmi_zone_enum = {
- {"FRONT", hmi_apis::Common_HmiZoneCapabilities::FRONT},
- {"BACK", hmi_apis::Common_HmiZoneCapabilities::BACK},
-};
-
-const std::map<std::string, hmi_apis::Common_ImageFieldName::eType>
- image_field_name_enum = {
- {"softButtonImage", hmi_apis::Common_ImageFieldName::softButtonImage},
- {"choiceImage", hmi_apis::Common_ImageFieldName::choiceImage},
- {"choiceSecondaryImage",
- hmi_apis::Common_ImageFieldName::choiceSecondaryImage},
- {"vrHelpItem", hmi_apis::Common_ImageFieldName::vrHelpItem},
- {"turnIcon", hmi_apis::Common_ImageFieldName::turnIcon},
- {"menuIcon", hmi_apis::Common_ImageFieldName::menuIcon},
- {"cmdIcon", hmi_apis::Common_ImageFieldName::cmdIcon},
- {"appIcon", hmi_apis::Common_ImageFieldName::appIcon},
- {"graphic", hmi_apis::Common_ImageFieldName::graphic},
- {"showConstantTBTIcon",
- hmi_apis::Common_ImageFieldName::showConstantTBTIcon},
- {"showConstantTBTNextTurnIcon",
- hmi_apis::Common_ImageFieldName::showConstantTBTNextTurnIcon},
- {"locationImage", hmi_apis::Common_ImageFieldName::locationImage}};
-
-const std::map<std::string, hmi_apis::Common_FileType::eType> file_type_enum = {
- {"GRAPHIC_BMP", hmi_apis::Common_FileType::GRAPHIC_BMP},
- {"GRAPHIC_JPEG", hmi_apis::Common_FileType::GRAPHIC_JPEG},
- {"GRAPHIC_PNG", hmi_apis::Common_FileType::GRAPHIC_PNG},
- {"AUDIO_WAVE", hmi_apis::Common_FileType::AUDIO_WAVE},
- {"AUDIO_MP3", hmi_apis::Common_FileType::AUDIO_MP3},
- {"AUDIO_AAC", hmi_apis::Common_FileType::AUDIO_AAC},
- {"BINARY", hmi_apis::Common_FileType::BINARY},
- {"JSON", hmi_apis::Common_FileType::JSON}};
-
-const std::map<std::string, hmi_apis::Common_DisplayType::eType>
- display_type_enum = {
- {"CID", hmi_apis::Common_DisplayType::CID},
- {"TYPE2", hmi_apis::Common_DisplayType::TYPE2},
- {"TYPE5", hmi_apis::Common_DisplayType::TYPE5},
- {"NGN", hmi_apis::Common_DisplayType::NGN},
- {"GEN2_8_DMA", hmi_apis::Common_DisplayType::GEN2_8_DMA},
- {"GEN2_6_DMA", hmi_apis::Common_DisplayType::GEN2_6_DMA},
- {"MFD3", hmi_apis::Common_DisplayType::MFD3},
- {"MFD4", hmi_apis::Common_DisplayType::MFD4},
- {"MFD5", hmi_apis::Common_DisplayType::MFD5},
- {"GEN3_8_INCH", hmi_apis::Common_DisplayType::GEN3_8_INCH}};
-
-const std::map<std::string, hmi_apis::Common_CharacterSet::eType>
- character_set_enum = {{"TYPE2SET", hmi_apis::Common_CharacterSet::TYPE2SET},
- {"TYPE5SET", hmi_apis::Common_CharacterSet::TYPE5SET},
- {"CID1SET", hmi_apis::Common_CharacterSet::CID1SET},
- {"CID2SET", hmi_apis::Common_CharacterSet::CID2SET}};
-
-HMICapabilities::HMICapabilities(ApplicationManager& app_mngr)
- : is_vr_cooperating_(false)
- , is_tts_cooperating_(false)
- , is_ui_cooperating_(false)
- , is_navi_cooperating_(false)
- , is_ivi_cooperating_(false)
- , is_vr_ready_response_recieved_(false)
- , is_tts_ready_response_recieved_(false)
- , is_ui_ready_response_recieved_(false)
- , is_navi_ready_response_recieved_(false)
- , is_ivi_ready_response_recieved_(false)
- , attenuated_supported_(false)
- , ui_language_(hmi_apis::Common_Language::INVALID_ENUM)
- , vr_language_(hmi_apis::Common_Language::INVALID_ENUM)
- , tts_language_(hmi_apis::Common_Language::INVALID_ENUM)
- , vehicle_type_(NULL)
- , ui_supported_languages_(NULL)
- , tts_supported_languages_(NULL)
- , vr_supported_languages_(NULL)
- , display_capabilities_(NULL)
- , hmi_zone_capabilities_(NULL)
- , soft_buttons_capabilities_(NULL)
- , button_capabilities_(NULL)
- , preset_bank_capabilities_(NULL)
- , vr_capabilities_(NULL)
- , speech_capabilities_(NULL)
- , audio_pass_thru_capabilities_(NULL)
- , pcm_stream_capabilities_(NULL)
- , prerecorded_speech_(NULL)
- , is_navigation_supported_(false)
- , is_phone_call_supported_(false)
- , app_mngr_(app_mngr)
- , hmi_language_handler_(app_mngr_) {
- if (false == app_mngr_.get_settings().launch_hmi()) {
- is_vr_ready_response_recieved_ = true;
- is_tts_ready_response_recieved_ = true;
- is_ui_ready_response_recieved_ = true;
- is_navi_ready_response_recieved_ = true;
- is_ivi_ready_response_recieved_ = true;
-
- is_vr_cooperating_ = true;
- is_tts_cooperating_ = true;
- is_ui_cooperating_ = true;
- is_navi_cooperating_ = true;
- is_ivi_cooperating_ = true;
- }
-}
-
-HMICapabilities::~HMICapabilities() {
- delete vehicle_type_;
- delete ui_supported_languages_;
- delete tts_supported_languages_;
- delete vr_supported_languages_;
- delete display_capabilities_;
- delete hmi_zone_capabilities_;
- delete soft_buttons_capabilities_;
- delete button_capabilities_;
- delete preset_bank_capabilities_;
- delete vr_capabilities_;
- delete speech_capabilities_;
- delete audio_pass_thru_capabilities_;
- delete pcm_stream_capabilities_;
- delete prerecorded_speech_;
-}
-
-bool HMICapabilities::is_hmi_capabilities_initialized() const {
- bool result = true;
-
- if (is_vr_ready_response_recieved_ && is_tts_ready_response_recieved_ &&
- is_ui_ready_response_recieved_ && is_navi_ready_response_recieved_ &&
- is_ivi_ready_response_recieved_) {
- if (is_vr_cooperating_) {
- if ((!vr_supported_languages_) ||
- (hmi_apis::Common_Language::INVALID_ENUM == vr_language_)) {
- result = false;
- }
- }
-
- if (is_tts_cooperating_) {
- if ((!tts_supported_languages_) ||
- (hmi_apis::Common_Language::INVALID_ENUM == tts_language_)) {
- result = false;
- }
- }
-
- if (is_ui_cooperating_) {
- if ((!ui_supported_languages_) ||
- (hmi_apis::Common_Language::INVALID_ENUM == ui_language_)) {
- result = false;
- }
- }
-
- if (is_ivi_cooperating_) {
- if (!vehicle_type_) {
- result = false;
- }
- }
- } else {
- result = false;
- }
-
- return result;
-}
-
-bool HMICapabilities::VerifyImageType(int32_t image_type) const {
- if (!display_capabilities_) {
- return false;
- }
-
- if (display_capabilities_->keyExists(hmi_response::image_capabilities)) {
- const smart_objects::SmartObject& image_caps =
- display_capabilities_->getElement(hmi_response::image_capabilities);
- for (uint32_t i = 0; i < image_caps.length(); ++i) {
- if (image_caps.getElement(i).asInt() == image_type) {
- return true;
- }
- }
- }
-
- return false;
-}
-
-void HMICapabilities::set_is_vr_cooperating(bool value) {
- is_vr_ready_response_recieved_ = true;
- is_vr_cooperating_ = value;
- if (is_vr_cooperating_) {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage,
- app_mngr_));
- hmi_language_handler_.set_handle_response_for(*get_language);
- app_mngr_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VR_GetSupportedLanguages, app_mngr_));
- app_mngr_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VR_GetCapabilities, app_mngr_));
- app_mngr_.ManageHMICommand(get_capabilities);
- }
-}
-
-void HMICapabilities::set_is_tts_cooperating(bool value) {
- is_tts_ready_response_recieved_ = true;
- is_tts_cooperating_ = value;
- if (is_tts_cooperating_) {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage,
- app_mngr_));
- hmi_language_handler_.set_handle_response_for(*get_language);
- app_mngr_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::TTS_GetSupportedLanguages, app_mngr_));
- app_mngr_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::TTS_GetCapabilities, app_mngr_));
- app_mngr_.ManageHMICommand(get_capabilities);
- }
-}
-
-void HMICapabilities::set_is_ui_cooperating(bool value) {
- is_ui_ready_response_recieved_ = true;
- is_ui_cooperating_ = value;
- if (is_ui_cooperating_) {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage,
- app_mngr_));
- hmi_language_handler_.set_handle_response_for(*get_language);
- app_mngr_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::UI_GetSupportedLanguages, app_mngr_));
- app_mngr_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::UI_GetCapabilities, app_mngr_));
- app_mngr_.ManageHMICommand(get_capabilities);
- }
-}
-
-void HMICapabilities::set_is_navi_cooperating(bool value) {
- is_navi_ready_response_recieved_ = true;
- is_navi_cooperating_ = value;
-}
-
-void HMICapabilities::set_is_ivi_cooperating(bool value) {
- is_ivi_ready_response_recieved_ = true;
- is_ivi_cooperating_ = value;
- if (is_ivi_cooperating_) {
- utils::SharedPtr<smart_objects::SmartObject> get_type(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleType, app_mngr_));
- app_mngr_.ManageHMICommand(get_type);
- }
-}
-
-void HMICapabilities::set_attenuated_supported(bool state) {
- attenuated_supported_ = state;
-}
-
-void HMICapabilities::set_active_ui_language(
- const hmi_apis::Common_Language::eType& language) {
- ui_language_ = language;
- hmi_language_handler_.set_language_for(HMILanguageHandler::INTERFACE_UI,
- language);
-}
-
-void HMICapabilities::set_active_vr_language(
- const hmi_apis::Common_Language::eType& language) {
- vr_language_ = language;
- hmi_language_handler_.set_language_for(HMILanguageHandler::INTERFACE_VR,
- language);
-}
-
-void HMICapabilities::set_active_tts_language(
- const hmi_apis::Common_Language::eType& language) {
- tts_language_ = language;
- hmi_language_handler_.set_language_for(HMILanguageHandler::INTERFACE_TTS,
- language);
-}
-
-const hmi_apis::Common_Language::eType HMICapabilities::active_ui_language()
- const {
- using namespace hmi_apis;
- const Common_Language::eType language =
- hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_UI);
- return Common_Language::INVALID_ENUM != language ? language : ui_language_;
-}
-
-const hmi_apis::Common_Language::eType HMICapabilities::active_vr_language()
- const {
- using namespace hmi_apis;
- const Common_Language::eType language =
- hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_VR);
- return Common_Language::INVALID_ENUM != language ? language : vr_language_;
-}
-
-const hmi_apis::Common_Language::eType HMICapabilities::active_tts_language()
- const {
- using namespace hmi_apis;
- const Common_Language::eType language =
- hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_TTS);
- return Common_Language::INVALID_ENUM != language ? language : tts_language_;
-}
-
-void HMICapabilities::set_ui_supported_languages(
- const smart_objects::SmartObject& supported_languages) {
- if (ui_supported_languages_) {
- delete ui_supported_languages_;
- }
- ui_supported_languages_ = new smart_objects::SmartObject(supported_languages);
-}
-
-void HMICapabilities::set_tts_supported_languages(
- const smart_objects::SmartObject& supported_languages) {
- if (tts_supported_languages_) {
- delete tts_supported_languages_;
- }
- tts_supported_languages_ =
- new smart_objects::SmartObject(supported_languages);
-}
-
-void HMICapabilities::set_vr_supported_languages(
- const smart_objects::SmartObject& supported_languages) {
- if (vr_supported_languages_) {
- delete vr_supported_languages_;
- }
- vr_supported_languages_ = new smart_objects::SmartObject(supported_languages);
-}
-
-void HMICapabilities::set_display_capabilities(
- const smart_objects::SmartObject& display_capabilities) {
- if (display_capabilities_) {
- delete display_capabilities_;
- }
- display_capabilities_ = new smart_objects::SmartObject(display_capabilities);
-}
-
-void HMICapabilities::set_hmi_zone_capabilities(
- const smart_objects::SmartObject& hmi_zone_capabilities) {
- if (hmi_zone_capabilities_) {
- delete hmi_zone_capabilities_;
- }
- hmi_zone_capabilities_ =
- new smart_objects::SmartObject(hmi_zone_capabilities);
-}
-
-void HMICapabilities::set_soft_button_capabilities(
- const smart_objects::SmartObject& soft_button_capabilities) {
- if (soft_buttons_capabilities_) {
- delete soft_buttons_capabilities_;
- }
- soft_buttons_capabilities_ =
- new smart_objects::SmartObject(soft_button_capabilities);
-}
-
-void HMICapabilities::set_button_capabilities(
- const smart_objects::SmartObject& button_capabilities) {
- if (button_capabilities_) {
- delete button_capabilities_;
- }
- button_capabilities_ = new smart_objects::SmartObject(button_capabilities);
-}
-
-void HMICapabilities::set_vr_capabilities(
- const smart_objects::SmartObject& vr_capabilities) {
- if (vr_capabilities_) {
- delete vr_capabilities_;
- }
- vr_capabilities_ = new smart_objects::SmartObject(vr_capabilities);
-}
-
-void HMICapabilities::set_speech_capabilities(
- const smart_objects::SmartObject& speech_capabilities) {
- if (speech_capabilities_) {
- delete speech_capabilities_;
- }
- speech_capabilities_ = new smart_objects::SmartObject(speech_capabilities);
-}
-
-void HMICapabilities::set_audio_pass_thru_capabilities(
- const smart_objects::SmartObject& audio_pass_thru_capabilities) {
- if (audio_pass_thru_capabilities_) {
- delete audio_pass_thru_capabilities_;
- }
- audio_pass_thru_capabilities_ =
- new smart_objects::SmartObject(audio_pass_thru_capabilities);
-}
-
-void HMICapabilities::set_pcm_stream_capabilities(
- const smart_objects::SmartObject& pcm_stream_capabilities) {
- if (pcm_stream_capabilities_) {
- delete pcm_stream_capabilities_;
- }
- pcm_stream_capabilities_ =
- new smart_objects::SmartObject(pcm_stream_capabilities);
-}
-
-void HMICapabilities::set_preset_bank_capabilities(
- const smart_objects::SmartObject& preset_bank_capabilities) {
- if (preset_bank_capabilities_) {
- delete preset_bank_capabilities_;
- }
- preset_bank_capabilities_ =
- new smart_objects::SmartObject(preset_bank_capabilities);
-}
-
-void HMICapabilities::set_vehicle_type(
- const smart_objects::SmartObject& vehicle_type) {
- if (vehicle_type_) {
- delete vehicle_type_;
- }
- vehicle_type_ = new smart_objects::SmartObject(vehicle_type);
-}
-
-void HMICapabilities::set_prerecorded_speech(
- const smart_objects::SmartObject& prerecorded_speech) {
- if (prerecorded_speech_) {
- delete prerecorded_speech_;
- prerecorded_speech_ = NULL;
- }
- prerecorded_speech_ = new smart_objects::SmartObject(prerecorded_speech);
-}
-
-void HMICapabilities::set_ccpu_version(const std::string& ccpu_version) {
- ccpu_version_ = ccpu_version;
-}
-
-void HMICapabilities::set_navigation_supported(const bool supported) {
- is_navigation_supported_ = supported;
-}
-
-void HMICapabilities::set_phone_call_supported(const bool supported) {
- is_phone_call_supported_ = supported;
-}
-
-void HMICapabilities::Init(resumption::LastState* last_state) {
- hmi_language_handler_.Init(last_state);
- if (false == load_capabilities_from_file()) {
- LOG4CXX_ERROR(logger_, "file hmi_capabilities.json was not loaded");
- } else {
- LOG4CXX_INFO(logger_, "file hmi_capabilities.json was loaded");
- }
- hmi_language_handler_.set_default_capabilities_languages(
- ui_language_, vr_language_, tts_language_);
-}
-
-bool HMICapabilities::load_capabilities_from_file() {
- std::string json_string;
- std::string file_name = app_mngr_.get_settings().hmi_capabilities_file_name();
-
- if (!file_system::FileExists(file_name)) {
- return false;
- }
-
- if (!file_system::ReadFile(file_name, json_string)) {
- return false;
- }
-
- try {
- Json::Reader reader_;
- Json::Value root_json;
-
- bool result = reader_.parse(json_string, root_json, false);
- if (!result) {
- return false;
- }
- // UI
- if (check_existing_json_member(root_json, "UI")) {
- Json::Value ui = root_json.get("UI", Json::Value::null);
-
- if (check_existing_json_member(ui, "language")) {
- const std::string lang = ui.get("language", "EN-US").asString();
- set_active_ui_language(MessageHelper::CommonLanguageFromString(lang));
- }
-
- if (check_existing_json_member(ui, "languages")) {
- smart_objects::SmartObject ui_languages_so(
- smart_objects::SmartType_Array);
- Json::Value languages_ui = ui.get("languages", "");
- convert_json_languages_to_obj(languages_ui, ui_languages_so);
- set_ui_supported_languages(ui_languages_so);
- }
-
- if (check_existing_json_member(ui, "displayCapabilities")) {
- smart_objects::SmartObject display_capabilities_so;
- Json::Value display_capabilities = ui.get("displayCapabilities", "");
- Formatters::CFormatterJsonBase::jsonValueToObj(display_capabilities,
- display_capabilities_so);
-
- if (display_capabilities_so.keyExists(hmi_response::display_type)) {
- std::map<std::string,
- hmi_apis::Common_DisplayType::eType>::const_iterator it =
- display_type_enum.find(
- (display_capabilities_so[hmi_response::display_type])
- .asString());
- display_capabilities_so.erase(hmi_response::display_type);
- if (display_type_enum.end() != it) {
- display_capabilities_so[hmi_response::display_type] = it->second;
- }
- }
-
- if (display_capabilities_so.keyExists(hmi_response::text_fields)) {
- uint32_t len =
- display_capabilities_so[hmi_response::text_fields].length();
-
- for (uint32_t i = 0; i < len; ++i) {
- if ((display_capabilities_so[hmi_response::text_fields][i])
- .keyExists(strings::name)) {
- std::map<std::string,
- hmi_apis::Common_TextFieldName::eType>::const_iterator
- it_text_field_name = text_fields_enum_name.find(
- display_capabilities_so[hmi_response::text_fields][i]
- [strings::name].asString());
- display_capabilities_so[hmi_response::text_fields][i].erase(
- strings::name);
- if (text_fields_enum_name.end() != it_text_field_name) {
- display_capabilities_so[hmi_response::text_fields][i]
- [strings::name] =
- it_text_field_name->second;
- }
- }
- if ((display_capabilities_so[hmi_response::text_fields][i])
- .keyExists(strings::character_set)) {
- std::map<std::string,
- hmi_apis::Common_CharacterSet::eType>::const_iterator
- it_characte_set = character_set_enum.find(
- display_capabilities_so[hmi_response::text_fields][i]
- [strings::character_set]
- .asString());
- display_capabilities_so[hmi_response::text_fields][i].erase(
- strings::character_set);
- if (character_set_enum.end() != it_characte_set) {
- display_capabilities_so[hmi_response::text_fields][i]
- [strings::character_set] =
- it_characte_set->second;
- }
- }
- }
- }
-
- if (display_capabilities_so.keyExists(hmi_response::image_fields)) {
- smart_objects::SmartObject& array_image_fields =
- display_capabilities_so[hmi_response::image_fields];
- for (uint32_t i = 0; i < array_image_fields.length(); ++i) {
- if (array_image_fields[i].keyExists(strings::name)) {
- std::map<std::string,
- hmi_apis::Common_ImageFieldName::eType>::const_iterator
- it = image_field_name_enum.find(
- (array_image_fields[i][strings::name]).asString());
- array_image_fields[i].erase(strings::name);
- if (image_field_name_enum.end() != it) {
- array_image_fields[i][strings::name] = it->second;
- }
- }
- if (array_image_fields[i].keyExists(
- strings::image_type_supported)) {
- smart_objects::SmartObject& image_type_supported_array =
- array_image_fields[i][strings::image_type_supported];
- smart_objects::SmartObject image_type_supported_enum(
- smart_objects::SmartType_Array);
- for (uint32_t k = 0, j = 0;
- k < image_type_supported_array.length();
- ++k) {
- std::map<std::string,
- hmi_apis::Common_FileType::eType>::const_iterator it =
- file_type_enum.find(
- (image_type_supported_array[k]).asString());
- if (file_type_enum.end() != it) {
- image_type_supported_enum[j++] = it->second;
- }
- }
- array_image_fields[i].erase(strings::image_type_supported);
- array_image_fields[i][strings::image_type_supported] =
- image_type_supported_enum;
- }
- }
- }
- if (display_capabilities_so.keyExists(
- hmi_response::media_clock_formats)) {
- smart_objects::SmartObject& media_clock_formats_array =
- display_capabilities_so[hmi_response::media_clock_formats];
- smart_objects::SmartObject media_clock_formats_enum(
- smart_objects::SmartType_Array);
- for (uint32_t i = 0, j = 0; i < media_clock_formats_array.length();
- ++i) {
- std::map<std::string,
- hmi_apis::Common_MediaClockFormat::eType>::const_iterator
- it = media_clock_enum_name.find(
- (media_clock_formats_array[i]).asString());
- if (media_clock_enum_name.end() != it) {
- media_clock_formats_enum[j++] = it->second;
- }
- }
- display_capabilities_so.erase(hmi_response::media_clock_formats);
- display_capabilities_so[hmi_response::media_clock_formats] =
- media_clock_formats_enum;
- }
-
- if (display_capabilities_so.keyExists(
- hmi_response::image_capabilities)) {
- smart_objects::SmartObject& image_capabilities_array =
- display_capabilities_so[hmi_response::image_capabilities];
- smart_objects::SmartObject image_capabilities_enum(
- smart_objects::SmartType_Array);
- for (uint32_t i = 0, j = 0; i < image_capabilities_array.length();
- ++i) {
- std::map<std::string,
- hmi_apis::Common_ImageType::eType>::const_iterator it =
- image_type_enum.find((image_capabilities_array[i]).asString());
- if (image_type_enum.end() != it) {
- image_capabilities_enum[j++] = it->second;
- }
- }
- display_capabilities_so.erase(hmi_response::image_capabilities);
- display_capabilities_so[hmi_response::image_capabilities] =
- image_capabilities_enum;
- }
- set_display_capabilities(display_capabilities_so);
- }
-
- if (check_existing_json_member(ui, "audioPassThruCapabilities")) {
- Json::Value audio_capabilities =
- ui.get("audioPassThruCapabilities", "");
- smart_objects::SmartObject audio_capabilities_so =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- audio_capabilities_so =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- if (check_existing_json_member(audio_capabilities, "samplingRate")) {
- audio_capabilities_so["samplingRate"] =
- sampling_rate_enum.find(audio_capabilities.get("samplingRate", "")
- .asString())->second;
- }
- if (check_existing_json_member(audio_capabilities, "bitsPerSample")) {
- audio_capabilities_so["bitsPerSample"] =
- bit_per_sample_enum.find(audio_capabilities.get("bitsPerSample",
- "").asString())
- ->second;
- }
- if (check_existing_json_member(audio_capabilities, "audioType")) {
- audio_capabilities_so["audioType"] =
- audio_type_enum.find(audio_capabilities.get("audioType", "")
- .asString())->second;
- }
- set_audio_pass_thru_capabilities(audio_capabilities_so);
- }
-
- if (check_existing_json_member(ui, "pcmStreamCapabilities")) {
- Json::Value pcm_capabilities = ui.get("pcmStreamCapabilities", "");
- smart_objects::SmartObject pcm_capabilities_so =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (check_existing_json_member(pcm_capabilities, "samplingRate")) {
- pcm_capabilities_so["samplingRate"] =
- sampling_rate_enum.find(pcm_capabilities.get("samplingRate", "")
- .asString())->second;
- }
- if (check_existing_json_member(pcm_capabilities, "bitsPerSample")) {
- pcm_capabilities_so["bitsPerSample"] =
- bit_per_sample_enum.find(pcm_capabilities.get("bitsPerSample", "")
- .asString())->second;
- }
- if (check_existing_json_member(pcm_capabilities, "audioType")) {
- pcm_capabilities_so["audioType"] =
- audio_type_enum.find(pcm_capabilities.get("audioType", "")
- .asString())->second;
- }
-
- set_pcm_stream_capabilities(pcm_capabilities_so);
- }
-
- if (check_existing_json_member(ui, "hmiZoneCapabilities")) {
- smart_objects::SmartObject hmi_zone_capabilities_so =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- hmi_zone_capabilities_so =
- hmi_zone_enum.find(ui.get("hmiZoneCapabilities", "").asString())
- ->second;
- set_hmi_zone_capabilities(hmi_zone_capabilities_so);
- }
-
- if (check_existing_json_member(ui, "softButtonCapabilities")) {
- Json::Value soft_button_capabilities =
- ui.get("softButtonCapabilities", "");
- smart_objects::SmartObject soft_button_capabilities_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(
- soft_button_capabilities, soft_button_capabilities_so);
- set_soft_button_capabilities(soft_button_capabilities_so);
- }
- } // UI end
-
- // VR
- if (check_existing_json_member(root_json, "VR")) {
- Json::Value vr = root_json.get("VR", "");
- if (check_existing_json_member(vr, "language")) {
- const std::string lang = vr.get("language", "EN-US").asString();
- set_active_vr_language(MessageHelper::CommonLanguageFromString(lang));
- }
-
- if (check_existing_json_member(vr, "languages")) {
- Json::Value languages_vr = vr.get("languages", "");
- smart_objects::SmartObject vr_languages_so =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- convert_json_languages_to_obj(languages_vr, vr_languages_so);
- set_vr_supported_languages(vr_languages_so);
- }
-
- if (check_existing_json_member(vr, "capabilities")) {
- Json::Value capabilities = vr.get("capabilities", "");
- smart_objects::SmartObject vr_capabilities_so =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- for (uint32_t i = 0; i < capabilities.size(); ++i) {
- vr_capabilities_so[i] =
- vr_enum_capabilities.find(capabilities[i].asString())->second;
- }
- set_vr_capabilities(vr_capabilities_so);
- }
- } // VR end
-
- // TTS
- if (check_existing_json_member(root_json, "TTS")) {
- Json::Value tts = root_json.get("TTS", "");
-
- if (check_existing_json_member(tts, "language")) {
- const std::string lang = tts.get("language", "EN-US").asString();
- set_active_tts_language(MessageHelper::CommonLanguageFromString(lang));
- }
-
- if (check_existing_json_member(tts, "languages")) {
- Json::Value languages_tts = tts.get("languages", "");
- smart_objects::SmartObject tts_languages_so =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- convert_json_languages_to_obj(languages_tts, tts_languages_so);
- set_tts_supported_languages(tts_languages_so);
- }
-
- if (check_existing_json_member(tts, "capabilities")) {
- set_speech_capabilities(
- smart_objects::SmartObject(tts.get("capabilities", "").asString()));
- }
- } // TTS end
-
- // Buttons
- if (check_existing_json_member(root_json, "Buttons")) {
- Json::Value buttons = root_json.get("Buttons", "");
- if (check_existing_json_member(buttons, "capabilities")) {
- Json::Value bt_capabilities = buttons.get("capabilities", "");
- smart_objects::SmartObject buttons_capabilities_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(bt_capabilities,
- buttons_capabilities_so);
-
- for (uint32_t i = 0; i < buttons_capabilities_so.length(); ++i) {
- if ((buttons_capabilities_so[i]).keyExists(strings::name)) {
- std::map<std::string,
- hmi_apis::Common_ButtonName::eType>::const_iterator it =
- button_enum_name.find(
- (buttons_capabilities_so[i][strings::name]).asString());
- buttons_capabilities_so[i].erase(strings::name);
- if (button_enum_name.end() != it) {
- buttons_capabilities_so[i][strings::name] = it->second;
- }
- }
- }
- set_button_capabilities(buttons_capabilities_so);
- }
- if (check_existing_json_member(buttons, "presetBankCapabilities")) {
- Json::Value presetBank = buttons.get("presetBankCapabilities", "");
- smart_objects::SmartObject preset_bank_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(presetBank,
- preset_bank_so);
- set_preset_bank_capabilities(preset_bank_so);
- }
- } // Buttons end
-
- // VehicleType
- if (check_existing_json_member(root_json, "VehicleInfo")) {
- Json::Value vehicle_info = root_json.get("VehicleInfo", "");
- smart_objects::SmartObject vehicle_type_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(vehicle_info,
- vehicle_type_so);
- set_vehicle_type(vehicle_type_so);
- } // VehicleType end
-
- } catch (...) {
- return false;
- }
- return true;
-}
-
-bool HMICapabilities::check_existing_json_member(const Json::Value& json_member,
- const char* name_of_member) {
- return json_member.isMember(name_of_member);
-}
-
-void HMICapabilities::convert_json_languages_to_obj(
- Json::Value& json_languages, smart_objects::SmartObject& languages) {
- for (uint32_t i = 0, j = 0; i < json_languages.size(); ++i) {
- languages[j++] =
- MessageHelper::CommonLanguageFromString(json_languages[i].asString());
- }
-}
-
-} // 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
new file mode 100644
index 0000000000..9d52cc98db
--- /dev/null
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -0,0 +1,1106 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 "utils/logger.h"
+#include "application_manager/hmi_capabilities_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "config_profile/profile.h"
+#include "formatters/CFormatterJsonBase.h"
+#include "interfaces/HMI_API.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+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;
+std::map<std::string, hmi_apis::Common_MediaClockFormat::eType>
+ media_clock_enum_name;
+std::map<std::string, hmi_apis::Common_ImageType::eType> image_type_enum;
+std::map<std::string, hmi_apis::Common_SamplingRate::eType> sampling_rate_enum;
+std::map<std::string, hmi_apis::Common_BitsPerSample::eType>
+ bit_per_sample_enum;
+std::map<std::string, hmi_apis::Common_AudioType::eType> audio_type_enum;
+std::map<std::string, hmi_apis::Common_HmiZoneCapabilities::eType>
+ hmi_zone_enum;
+std::map<std::string, hmi_apis::Common_ImageFieldName::eType>
+ image_field_name_enum;
+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;
+
+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(
+ std::string("SEEKLEFT"), hmi_apis::Common_ButtonName::SEEKLEFT));
+ button_enum_name.insert(std::make_pair(
+ std::string("SEEKRIGHT"), hmi_apis::Common_ButtonName::SEEKRIGHT));
+ button_enum_name.insert(std::make_pair(std::string("TUNEUP"),
+ hmi_apis::Common_ButtonName::TUNEUP));
+ button_enum_name.insert(std::make_pair(
+ std::string("TUNEDOWN"), hmi_apis::Common_ButtonName::TUNEDOWN));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_0"), hmi_apis::Common_ButtonName::PRESET_0));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_1"), hmi_apis::Common_ButtonName::PRESET_1));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_2"), hmi_apis::Common_ButtonName::PRESET_2));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_3"), hmi_apis::Common_ButtonName::PRESET_3));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_4"), hmi_apis::Common_ButtonName::PRESET_4));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_5"), hmi_apis::Common_ButtonName::PRESET_5));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_6"), hmi_apis::Common_ButtonName::PRESET_6));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_7"), hmi_apis::Common_ButtonName::PRESET_7));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_8"), hmi_apis::Common_ButtonName::PRESET_8));
+ button_enum_name.insert(std::make_pair(
+ std::string("PRESET_9"), hmi_apis::Common_ButtonName::PRESET_9));
+ button_enum_name.insert(
+ std::make_pair(std::string("CUSTOM_BUTTON"),
+ hmi_apis::Common_ButtonName::CUSTOM_BUTTON));
+ button_enum_name.insert(std::make_pair(std::string("SEARCH"),
+ hmi_apis::Common_ButtonName::SEARCH));
+
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("mainField1"), hmi_apis::Common_TextFieldName::mainField1));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("mainField2"), hmi_apis::Common_TextFieldName::mainField2));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("mainField3"), hmi_apis::Common_TextFieldName::mainField3));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("mainField4"), hmi_apis::Common_TextFieldName::mainField4));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("statusBar"), hmi_apis::Common_TextFieldName::statusBar));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("mediaClock"), hmi_apis::Common_TextFieldName::mediaClock));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("mediaTrack"), hmi_apis::Common_TextFieldName::mediaTrack));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("alertText1"), hmi_apis::Common_TextFieldName::alertText1));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("alertText2"), hmi_apis::Common_TextFieldName::alertText2));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("alertText3"), hmi_apis::Common_TextFieldName::alertText3));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("scrollableMessageBody"),
+ hmi_apis::Common_TextFieldName::scrollableMessageBody));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("initialInteractionText"),
+ hmi_apis::Common_TextFieldName::initialInteractionText));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("navigationText1"),
+ hmi_apis::Common_TextFieldName::navigationText1));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("navigationText2"),
+ hmi_apis::Common_TextFieldName::navigationText2));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("ETA"), hmi_apis::Common_TextFieldName::ETA));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("totalDistance"),
+ hmi_apis::Common_TextFieldName::totalDistance));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("audioPassThruDisplayText1"),
+ hmi_apis::Common_TextFieldName::audioPassThruDisplayText1));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("audioPassThruDisplayText2"),
+ hmi_apis::Common_TextFieldName::audioPassThruDisplayText2));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("sliderHeader"),
+ hmi_apis::Common_TextFieldName::sliderHeader));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("sliderFooter"),
+ hmi_apis::Common_TextFieldName::sliderFooter));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("navigationText"),
+ hmi_apis::Common_TextFieldName::navigationText));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("notificationText"),
+ hmi_apis::Common_TextFieldName::notificationText));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("menuName"), hmi_apis::Common_TextFieldName::menuName));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("secondaryText"),
+ hmi_apis::Common_TextFieldName::secondaryText));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("tertiaryText"),
+ hmi_apis::Common_TextFieldName::tertiaryText));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("timeToDestination"),
+ hmi_apis::Common_TextFieldName::timeToDestination));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("locationName"),
+ hmi_apis::Common_TextFieldName::locationName));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("locationDescription"),
+ hmi_apis::Common_TextFieldName::locationDescription));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("turnText"), hmi_apis::Common_TextFieldName::turnText));
+ text_fields_enum_name.insert(
+ std::make_pair(std::string("addressLines"),
+ hmi_apis::Common_TextFieldName::addressLines));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("phoneNumber"), hmi_apis::Common_TextFieldName::phoneNumber));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("turnText"), hmi_apis::Common_TextFieldName::turnText));
+ text_fields_enum_name.insert(std::make_pair(
+ std::string("menuTitle"), hmi_apis::Common_TextFieldName::menuTitle));
+
+ media_clock_enum_name.insert(std::make_pair(
+ std::string("CLOCK1"), hmi_apis::Common_MediaClockFormat::CLOCK1));
+ media_clock_enum_name.insert(std::make_pair(
+ std::string("CLOCK2"), hmi_apis::Common_MediaClockFormat::CLOCK2));
+ media_clock_enum_name.insert(std::make_pair(
+ std::string("CLOCK3"), hmi_apis::Common_MediaClockFormat::CLOCK3));
+ media_clock_enum_name.insert(
+ std::make_pair(std::string("CLOCKTEXT1"),
+ hmi_apis::Common_MediaClockFormat::CLOCKTEXT1));
+ media_clock_enum_name.insert(
+ std::make_pair(std::string("CLOCKTEXT2"),
+ hmi_apis::Common_MediaClockFormat::CLOCKTEXT2));
+ media_clock_enum_name.insert(
+ std::make_pair(std::string("CLOCKTEXT3"),
+ hmi_apis::Common_MediaClockFormat::CLOCKTEXT3));
+ media_clock_enum_name.insert(
+ std::make_pair(std::string("CLOCKTEXT4"),
+ hmi_apis::Common_MediaClockFormat::CLOCKTEXT4));
+
+ image_type_enum.insert(std::make_pair(std::string("STATIC"),
+ hmi_apis::Common_ImageType::STATIC));
+ image_type_enum.insert(std::make_pair(std::string("DYNAMIC"),
+ hmi_apis::Common_ImageType::DYNAMIC));
+
+ sampling_rate_enum.insert(std::make_pair(
+ std::string("8KHZ"), hmi_apis::Common_SamplingRate::RATE_8KHZ));
+ sampling_rate_enum.insert(std::make_pair(
+ std::string("16KHZ"), hmi_apis::Common_SamplingRate::RATE_16KHZ));
+ sampling_rate_enum.insert(std::make_pair(
+ std::string("22KHZ"), hmi_apis::Common_SamplingRate::RATE_22KHZ));
+ sampling_rate_enum.insert(std::make_pair(
+ std::string("44KHZ"), hmi_apis::Common_SamplingRate::RATE_44KHZ));
+
+ bit_per_sample_enum.insert(std::make_pair(
+ std::string("RATE_8_BIT"), hmi_apis::Common_BitsPerSample::RATE_8_BIT));
+ bit_per_sample_enum.insert(std::make_pair(
+ std::string("RATE_16_BIT"), hmi_apis::Common_BitsPerSample::RATE_16_BIT));
+
+ audio_type_enum.insert(
+ std::make_pair(std::string("PCM"), hmi_apis::Common_AudioType::PCM));
+
+ hmi_zone_enum.insert(std::make_pair(
+ std::string("FRONT"), hmi_apis::Common_HmiZoneCapabilities::FRONT));
+ hmi_zone_enum.insert(std::make_pair(
+ std::string("BACK"), hmi_apis::Common_HmiZoneCapabilities::BACK));
+
+ image_field_name_enum.insert(
+ std::make_pair(std::string("softButtonImage"),
+ hmi_apis::Common_ImageFieldName::softButtonImage));
+ image_field_name_enum.insert(
+ std::make_pair(std::string("choiceImage"),
+ hmi_apis::Common_ImageFieldName::choiceImage));
+ image_field_name_enum.insert(
+ std::make_pair(std::string("choiceSecondaryImage"),
+ hmi_apis::Common_ImageFieldName::choiceSecondaryImage));
+ image_field_name_enum.insert(std::make_pair(
+ std::string("vrHelpItem"), hmi_apis::Common_ImageFieldName::vrHelpItem));
+ image_field_name_enum.insert(std::make_pair(
+ std::string("turnIcon"), hmi_apis::Common_ImageFieldName::turnIcon));
+ image_field_name_enum.insert(std::make_pair(
+ std::string("menuIcon"), hmi_apis::Common_ImageFieldName::menuIcon));
+ image_field_name_enum.insert(std::make_pair(
+ std::string("cmdIcon"), hmi_apis::Common_ImageFieldName::cmdIcon));
+ image_field_name_enum.insert(std::make_pair(
+ std::string("appIcon"), hmi_apis::Common_ImageFieldName::appIcon));
+ image_field_name_enum.insert(std::make_pair(
+ std::string("graphic"), hmi_apis::Common_ImageFieldName::graphic));
+ image_field_name_enum.insert(
+ std::make_pair(std::string("showConstantTBTIcon"),
+ hmi_apis::Common_ImageFieldName::showConstantTBTIcon));
+ image_field_name_enum.insert(std::make_pair(
+ std::string("showConstantTBTNextTurnIcon"),
+ hmi_apis::Common_ImageFieldName::showConstantTBTNextTurnIcon));
+ image_field_name_enum.insert(
+ std::make_pair(std::string("locationImage"),
+ hmi_apis::Common_ImageFieldName::locationImage));
+
+ file_type_enum.insert(std::make_pair(std::string("GRAPHIC_BMP"),
+ hmi_apis::Common_FileType::GRAPHIC_BMP));
+ file_type_enum.insert(std::make_pair(
+ std::string("GRAPHIC_JPEG"), hmi_apis::Common_FileType::GRAPHIC_JPEG));
+ file_type_enum.insert(std::make_pair(std::string("GRAPHIC_PNG"),
+ hmi_apis::Common_FileType::GRAPHIC_PNG));
+ file_type_enum.insert(std::make_pair(std::string("AUDIO_WAVE"),
+ hmi_apis::Common_FileType::AUDIO_WAVE));
+ file_type_enum.insert(std::make_pair(std::string("AUDIO_MP3"),
+ hmi_apis::Common_FileType::AUDIO_MP3));
+ file_type_enum.insert(std::make_pair(std::string("AUDIO_AAC"),
+ hmi_apis::Common_FileType::AUDIO_AAC));
+ file_type_enum.insert(
+ std::make_pair(std::string("BINARY"), hmi_apis::Common_FileType::BINARY));
+ file_type_enum.insert(
+ std::make_pair(std::string("JSON"), hmi_apis::Common_FileType::JSON));
+
+ display_type_enum.insert(
+ std::make_pair(std::string("CID"), hmi_apis::Common_DisplayType::CID));
+ display_type_enum.insert(std::make_pair(std::string("TYPE2"),
+ hmi_apis::Common_DisplayType::TYPE2));
+ display_type_enum.insert(std::make_pair(std::string("TYPE5"),
+ hmi_apis::Common_DisplayType::TYPE5));
+ display_type_enum.insert(
+ std::make_pair(std::string("NGN"), hmi_apis::Common_DisplayType::NGN));
+ display_type_enum.insert(std::make_pair(
+ std::string("GEN2_8_DMA"), hmi_apis::Common_DisplayType::GEN2_8_DMA));
+ display_type_enum.insert(std::make_pair(
+ std::string("GEN2_6_DMA"), hmi_apis::Common_DisplayType::GEN2_6_DMA));
+ display_type_enum.insert(
+ std::make_pair(std::string("MFD3"), hmi_apis::Common_DisplayType::MFD3));
+ display_type_enum.insert(
+ std::make_pair(std::string("MFD4"), hmi_apis::Common_DisplayType::MFD4));
+ display_type_enum.insert(
+ std::make_pair(std::string("MFD5"), hmi_apis::Common_DisplayType::MFD5));
+ display_type_enum.insert(std::make_pair(
+ std::string("GEN3_8_INCH"), hmi_apis::Common_DisplayType::GEN3_8_INCH));
+
+ character_set_enum.insert(std::make_pair(
+ std::string("TYPE2SET"), hmi_apis::Common_CharacterSet::TYPE2SET));
+ character_set_enum.insert(std::make_pair(
+ std::string("TYPE5SET"), hmi_apis::Common_CharacterSet::TYPE5SET));
+ character_set_enum.insert(std::make_pair(
+ std::string("CID1SET"), hmi_apis::Common_CharacterSet::CID1SET));
+ character_set_enum.insert(std::make_pair(
+ std::string("CID2SET"), hmi_apis::Common_CharacterSet::CID2SET));
+}
+
+} // namespace
+
+HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
+ : is_vr_cooperating_(false)
+ , is_tts_cooperating_(false)
+ , is_ui_cooperating_(false)
+ , is_navi_cooperating_(false)
+ , is_ivi_cooperating_(false)
+ , attenuated_supported_(false)
+ , ui_language_(hmi_apis::Common_Language::INVALID_ENUM)
+ , vr_language_(hmi_apis::Common_Language::INVALID_ENUM)
+ , tts_language_(hmi_apis::Common_Language::INVALID_ENUM)
+ , vehicle_type_(NULL)
+ , ui_supported_languages_(NULL)
+ , tts_supported_languages_(NULL)
+ , vr_supported_languages_(NULL)
+ , display_capabilities_(NULL)
+ , hmi_zone_capabilities_(NULL)
+ , soft_buttons_capabilities_(NULL)
+ , button_capabilities_(NULL)
+ , preset_bank_capabilities_(NULL)
+ , vr_capabilities_(NULL)
+ , speech_capabilities_(NULL)
+ , audio_pass_thru_capabilities_(NULL)
+ , pcm_stream_capabilities_(NULL)
+ , prerecorded_speech_(NULL)
+ , is_navigation_supported_(false)
+ , is_phone_call_supported_(false)
+ , app_mngr_(app_mngr)
+ , hmi_language_handler_(app_mngr) {
+ InitCapabilities();
+ if (false == app_mngr_.get_settings().launch_hmi()) {
+ is_vr_cooperating_ = true;
+ is_tts_cooperating_ = true;
+ is_ui_cooperating_ = true;
+ is_navi_cooperating_ = true;
+ is_ivi_cooperating_ = true;
+ }
+}
+
+HMICapabilitiesImpl::~HMICapabilitiesImpl() {
+ delete vehicle_type_;
+ delete ui_supported_languages_;
+ delete tts_supported_languages_;
+ delete vr_supported_languages_;
+ delete display_capabilities_;
+ delete hmi_zone_capabilities_;
+ delete soft_buttons_capabilities_;
+ delete button_capabilities_;
+ delete preset_bank_capabilities_;
+ delete vr_capabilities_;
+ delete speech_capabilities_;
+ delete audio_pass_thru_capabilities_;
+ delete pcm_stream_capabilities_;
+ delete prerecorded_speech_;
+}
+
+bool HMICapabilitiesImpl::VerifyImageType(const int32_t image_type) const {
+ if (!display_capabilities_) {
+ return false;
+ }
+
+ if (display_capabilities_->keyExists(hmi_response::image_capabilities)) {
+ const smart_objects::SmartObject& image_caps =
+ display_capabilities_->getElement(hmi_response::image_capabilities);
+ for (uint32_t i = 0; i < image_caps.length(); ++i) {
+ if (image_caps.getElement(i).asInt() == image_type) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+void HMICapabilitiesImpl::set_is_vr_cooperating(const bool value) {
+ is_vr_cooperating_ = value;
+}
+
+void HMICapabilitiesImpl::set_is_tts_cooperating(const bool value) {
+ is_tts_cooperating_ = value;
+}
+
+void HMICapabilitiesImpl::set_is_ui_cooperating(const bool value) {
+ is_ui_cooperating_ = value;
+}
+
+void HMICapabilitiesImpl::set_is_navi_cooperating(const bool value) {
+ is_navi_cooperating_ = value;
+}
+
+void HMICapabilitiesImpl::set_is_ivi_cooperating(const bool value) {
+ is_ivi_cooperating_ = value;
+}
+
+void HMICapabilitiesImpl::set_attenuated_supported(const bool state) {
+ attenuated_supported_ = state;
+}
+
+void HMICapabilitiesImpl::set_active_ui_language(
+ const hmi_apis::Common_Language::eType language) {
+ ui_language_ = language;
+ hmi_language_handler_.set_language_for(HMILanguageHandler::INTERFACE_UI,
+ language);
+}
+
+void HMICapabilitiesImpl::set_active_vr_language(
+ const hmi_apis::Common_Language::eType language) {
+ vr_language_ = language;
+ hmi_language_handler_.set_language_for(HMILanguageHandler::INTERFACE_VR,
+ language);
+}
+
+void HMICapabilitiesImpl::set_active_tts_language(
+ const hmi_apis::Common_Language::eType language) {
+ tts_language_ = language;
+ hmi_language_handler_.set_language_for(HMILanguageHandler::INTERFACE_TTS,
+ language);
+}
+
+const hmi_apis::Common_Language::eType HMICapabilitiesImpl::active_ui_language()
+ const {
+ using namespace hmi_apis;
+ const Common_Language::eType language =
+ hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_UI);
+ return Common_Language::INVALID_ENUM != language ? language : ui_language_;
+}
+
+const hmi_apis::Common_Language::eType HMICapabilitiesImpl::active_vr_language()
+ const {
+ using namespace hmi_apis;
+ const Common_Language::eType language =
+ hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_VR);
+ return Common_Language::INVALID_ENUM != language ? language : vr_language_;
+}
+
+const hmi_apis::Common_Language::eType
+HMICapabilitiesImpl::active_tts_language() const {
+ using namespace hmi_apis;
+ const Common_Language::eType language =
+ hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_TTS);
+ return Common_Language::INVALID_ENUM != language ? language : tts_language_;
+}
+
+void HMICapabilitiesImpl::set_ui_supported_languages(
+ const smart_objects::SmartObject& supported_languages) {
+ if (ui_supported_languages_) {
+ delete ui_supported_languages_;
+ }
+ ui_supported_languages_ = new smart_objects::SmartObject(supported_languages);
+}
+
+void HMICapabilitiesImpl::set_tts_supported_languages(
+ const smart_objects::SmartObject& supported_languages) {
+ if (tts_supported_languages_) {
+ delete tts_supported_languages_;
+ }
+ tts_supported_languages_ =
+ new smart_objects::SmartObject(supported_languages);
+}
+
+void HMICapabilitiesImpl::set_vr_supported_languages(
+ const smart_objects::SmartObject& supported_languages) {
+ if (vr_supported_languages_) {
+ delete vr_supported_languages_;
+ }
+ vr_supported_languages_ = new smart_objects::SmartObject(supported_languages);
+}
+
+void HMICapabilitiesImpl::set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) {
+ if (display_capabilities_) {
+ delete display_capabilities_;
+ }
+ display_capabilities_ = new smart_objects::SmartObject(display_capabilities);
+}
+
+void HMICapabilitiesImpl::set_hmi_zone_capabilities(
+ const smart_objects::SmartObject& hmi_zone_capabilities) {
+ if (hmi_zone_capabilities_) {
+ delete hmi_zone_capabilities_;
+ }
+ hmi_zone_capabilities_ =
+ new smart_objects::SmartObject(hmi_zone_capabilities);
+}
+
+void HMICapabilitiesImpl::set_soft_button_capabilities(
+ const smart_objects::SmartObject& soft_button_capabilities) {
+ if (soft_buttons_capabilities_) {
+ delete soft_buttons_capabilities_;
+ }
+ soft_buttons_capabilities_ =
+ new smart_objects::SmartObject(soft_button_capabilities);
+}
+
+void HMICapabilitiesImpl::set_button_capabilities(
+ const smart_objects::SmartObject& button_capabilities) {
+ if (button_capabilities_) {
+ delete button_capabilities_;
+ }
+ button_capabilities_ = new smart_objects::SmartObject(button_capabilities);
+}
+
+void HMICapabilitiesImpl::set_vr_capabilities(
+ const smart_objects::SmartObject& vr_capabilities) {
+ if (vr_capabilities_) {
+ delete vr_capabilities_;
+ }
+ vr_capabilities_ = new smart_objects::SmartObject(vr_capabilities);
+}
+
+void HMICapabilitiesImpl::set_speech_capabilities(
+ const smart_objects::SmartObject& speech_capabilities) {
+ if (speech_capabilities_) {
+ delete speech_capabilities_;
+ }
+ speech_capabilities_ = new smart_objects::SmartObject(speech_capabilities);
+}
+
+void HMICapabilitiesImpl::set_audio_pass_thru_capabilities(
+ const smart_objects::SmartObject& audio_pass_thru_capabilities) {
+ if (audio_pass_thru_capabilities_) {
+ delete audio_pass_thru_capabilities_;
+ }
+ audio_pass_thru_capabilities_ =
+ new smart_objects::SmartObject(audio_pass_thru_capabilities);
+}
+
+void HMICapabilitiesImpl::set_pcm_stream_capabilities(
+ const smart_objects::SmartObject& pcm_stream_capabilities) {
+ if (pcm_stream_capabilities_) {
+ delete pcm_stream_capabilities_;
+ }
+ pcm_stream_capabilities_ =
+ new smart_objects::SmartObject(pcm_stream_capabilities);
+}
+
+void HMICapabilitiesImpl::set_preset_bank_capabilities(
+ const smart_objects::SmartObject& preset_bank_capabilities) {
+ if (preset_bank_capabilities_) {
+ delete preset_bank_capabilities_;
+ }
+ preset_bank_capabilities_ =
+ new smart_objects::SmartObject(preset_bank_capabilities);
+}
+
+void HMICapabilitiesImpl::set_vehicle_type(
+ const smart_objects::SmartObject& vehicle_type) {
+ if (vehicle_type_) {
+ delete vehicle_type_;
+ }
+ vehicle_type_ = new smart_objects::SmartObject(vehicle_type);
+}
+
+void HMICapabilitiesImpl::set_prerecorded_speech(
+ const smart_objects::SmartObject& prerecorded_speech) {
+ if (prerecorded_speech_) {
+ delete prerecorded_speech_;
+ prerecorded_speech_ = NULL;
+ }
+ prerecorded_speech_ = new smart_objects::SmartObject(prerecorded_speech);
+}
+
+void HMICapabilitiesImpl::set_navigation_supported(const bool supported) {
+ is_navigation_supported_ = supported;
+}
+void HMICapabilitiesImpl::set_phone_call_supported(const bool supported) {
+ is_phone_call_supported_ = supported;
+}
+
+void HMICapabilitiesImpl::Init(resumption::LastState* last_state) {
+ hmi_language_handler_.Init(last_state);
+ if (false == load_capabilities_from_file()) {
+ LOG4CXX_ERROR(logger_, "file hmi_capabilities.json was not loaded");
+ } else {
+ LOG4CXX_INFO(logger_, "file hmi_capabilities.json was loaded");
+ }
+ hmi_language_handler_.set_default_capabilities_languages(
+ ui_language_, vr_language_, tts_language_);
+}
+
+bool HMICapabilitiesImpl::is_ui_cooperating() const {
+ return is_ui_cooperating_;
+}
+
+bool HMICapabilitiesImpl::is_vr_cooperating() const {
+ return is_vr_cooperating_;
+}
+
+bool HMICapabilitiesImpl::is_tts_cooperating() const {
+ return is_tts_cooperating_;
+}
+
+bool HMICapabilitiesImpl::is_navi_cooperating() const {
+ return is_navi_cooperating_;
+}
+
+bool HMICapabilitiesImpl::is_ivi_cooperating() const {
+ return is_ivi_cooperating_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::ui_supported_languages()
+ const {
+ return ui_supported_languages_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::vr_supported_languages()
+ const {
+ return vr_supported_languages_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::tts_supported_languages()
+ const {
+ return tts_supported_languages_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::display_capabilities()
+ const {
+ return display_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::hmi_zone_capabilities()
+ const {
+ return hmi_zone_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilitiesImpl::soft_button_capabilities() const {
+ return soft_buttons_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::button_capabilities()
+ const {
+ return button_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::speech_capabilities()
+ const {
+ return speech_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::vr_capabilities() const {
+ return vr_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilitiesImpl::audio_pass_thru_capabilities() const {
+ return audio_pass_thru_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::pcm_stream_capabilities()
+ const {
+ return pcm_stream_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilitiesImpl::preset_bank_capabilities() const {
+ return preset_bank_capabilities_;
+}
+
+bool HMICapabilitiesImpl::attenuated_supported() const {
+ return attenuated_supported_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::vehicle_type() const {
+ return vehicle_type_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::prerecorded_speech()
+ const {
+ return prerecorded_speech_;
+}
+
+bool HMICapabilitiesImpl::navigation_supported() const {
+ return is_navigation_supported_;
+}
+
+bool HMICapabilitiesImpl::phone_call_supported() const {
+ return is_phone_call_supported_;
+}
+
+bool HMICapabilitiesImpl::load_capabilities_from_file() {
+ std::string json_string;
+ std::string file_name = app_mngr_.get_settings().hmi_capabilities_file_name();
+
+ if (!file_system::FileExists(file_name)) {
+ return false;
+ }
+
+ if (!file_system::ReadFile(file_name, json_string)) {
+ return false;
+ }
+
+ try {
+ Json::Reader reader_;
+ Json::Value root_json;
+
+ bool result = reader_.parse(json_string, root_json, false);
+ if (!result) {
+ return false;
+ }
+ // UI
+ if (check_existing_json_member(root_json, "UI")) {
+ Json::Value ui = root_json.get("UI", Json::Value::null);
+
+ if (check_existing_json_member(ui, "language")) {
+ const std::string lang = ui.get("language", "EN-US").asString();
+ set_active_ui_language(MessageHelper::CommonLanguageFromString(lang));
+ } else {
+ set_active_ui_language(
+ MessageHelper::CommonLanguageFromString("EN-US"));
+ }
+
+ if (check_existing_json_member(ui, "languages")) {
+ smart_objects::SmartObject ui_languages_so(
+ smart_objects::SmartType_Array);
+ Json::Value languages_ui = ui.get("languages", "");
+ convert_json_languages_to_obj(languages_ui, ui_languages_so);
+ set_ui_supported_languages(ui_languages_so);
+ }
+
+ if (check_existing_json_member(ui, "displayCapabilities")) {
+ smart_objects::SmartObject display_capabilities_so;
+ Json::Value display_capabilities = ui.get("displayCapabilities", "");
+ Formatters::CFormatterJsonBase::jsonValueToObj(display_capabilities,
+ display_capabilities_so);
+
+ if (display_capabilities_so.keyExists(hmi_response::display_type)) {
+ std::map<std::string,
+ hmi_apis::Common_DisplayType::eType>::const_iterator it =
+ display_type_enum.find(
+ (display_capabilities_so[hmi_response::display_type])
+ .asString());
+ display_capabilities_so.erase(hmi_response::display_type);
+ if (display_type_enum.end() != it) {
+ display_capabilities_so[hmi_response::display_type] = it->second;
+ }
+ }
+
+ if (display_capabilities_so.keyExists(hmi_response::text_fields)) {
+ const uint32_t kLen =
+ display_capabilities_so[hmi_response::text_fields].length();
+
+ for (uint32_t i = 0; i < kLen; ++i) {
+ if ((display_capabilities_so[hmi_response::text_fields][i])
+ .keyExists(strings::name)) {
+ std::map<std::string,
+ hmi_apis::Common_TextFieldName::eType>::const_iterator
+ it_text_field_name = text_fields_enum_name.find(
+ display_capabilities_so[hmi_response::text_fields][i]
+ [strings::name].asString());
+ display_capabilities_so[hmi_response::text_fields][i].erase(
+ strings::name);
+ if (text_fields_enum_name.end() != it_text_field_name) {
+ display_capabilities_so[hmi_response::text_fields][i]
+ [strings::name] =
+ it_text_field_name->second;
+ }
+ }
+ if ((display_capabilities_so[hmi_response::text_fields][i])
+ .keyExists(strings::character_set)) {
+ std::map<std::string,
+ hmi_apis::Common_CharacterSet::eType>::const_iterator
+ it_characte_set = character_set_enum.find(
+ display_capabilities_so[hmi_response::text_fields][i]
+ [strings::character_set]
+ .asString());
+ display_capabilities_so[hmi_response::text_fields][i].erase(
+ strings::character_set);
+ if (character_set_enum.end() != it_characte_set) {
+ display_capabilities_so[hmi_response::text_fields][i]
+ [strings::character_set] =
+ it_characte_set->second;
+ }
+ }
+ }
+ }
+
+ if (display_capabilities_so.keyExists(hmi_response::image_fields)) {
+ smart_objects::SmartObject& array_image_fields =
+ display_capabilities_so[hmi_response::image_fields];
+ for (uint32_t i = 0; i < array_image_fields.length(); ++i) {
+ if (array_image_fields[i].keyExists(strings::name)) {
+ std::map<std::string,
+ hmi_apis::Common_ImageFieldName::eType>::const_iterator
+ it = image_field_name_enum.find(
+ (array_image_fields[i][strings::name]).asString());
+ array_image_fields[i].erase(strings::name);
+ if (image_field_name_enum.end() != it) {
+ array_image_fields[i][strings::name] = it->second;
+ }
+ }
+ if (array_image_fields[i].keyExists(
+ strings::image_type_supported)) {
+ smart_objects::SmartObject& image_type_supported_array =
+ array_image_fields[i][strings::image_type_supported];
+ smart_objects::SmartObject image_type_supported_enum(
+ smart_objects::SmartType_Array);
+ for (uint32_t k = 0, j = 0;
+ k < image_type_supported_array.length();
+ ++k) {
+ std::map<std::string,
+ hmi_apis::Common_FileType::eType>::const_iterator it =
+ file_type_enum.find(
+ (image_type_supported_array[k]).asString());
+ if (file_type_enum.end() != it) {
+ image_type_supported_enum[j++] = it->second;
+ }
+ }
+ array_image_fields[i].erase(strings::image_type_supported);
+ array_image_fields[i][strings::image_type_supported] =
+ image_type_supported_enum;
+ }
+ }
+ }
+ if (display_capabilities_so.keyExists(
+ hmi_response::media_clock_formats)) {
+ smart_objects::SmartObject& media_clock_formats_array =
+ display_capabilities_so[hmi_response::media_clock_formats];
+ smart_objects::SmartObject media_clock_formats_enum(
+ smart_objects::SmartType_Array);
+ for (uint32_t i = 0, j = 0; i < media_clock_formats_array.length();
+ ++i) {
+ std::map<std::string,
+ hmi_apis::Common_MediaClockFormat::eType>::const_iterator
+ it = media_clock_enum_name.find(
+ (media_clock_formats_array[i]).asString());
+ if (media_clock_enum_name.end() != it) {
+ media_clock_formats_enum[j++] = it->second;
+ }
+ }
+ display_capabilities_so.erase(hmi_response::media_clock_formats);
+ display_capabilities_so[hmi_response::media_clock_formats] =
+ media_clock_formats_enum;
+ }
+
+ if (display_capabilities_so.keyExists(
+ hmi_response::image_capabilities)) {
+ smart_objects::SmartObject& image_capabilities_array =
+ display_capabilities_so[hmi_response::image_capabilities];
+ smart_objects::SmartObject image_capabilities_enum(
+ smart_objects::SmartType_Array);
+ for (uint32_t i = 0, j = 0; i < image_capabilities_array.length();
+ ++i) {
+ std::map<std::string,
+ hmi_apis::Common_ImageType::eType>::const_iterator it =
+ image_type_enum.find((image_capabilities_array[i]).asString());
+ if (image_type_enum.end() != it) {
+ image_capabilities_enum[j++] = it->second;
+ }
+ }
+ display_capabilities_so.erase(hmi_response::image_capabilities);
+ display_capabilities_so[hmi_response::image_capabilities] =
+ image_capabilities_enum;
+ }
+ set_display_capabilities(display_capabilities_so);
+ }
+
+ if (check_existing_json_member(ui, "audioPassThruCapabilities")) {
+ Json::Value audio_capabilities =
+ ui.get("audioPassThruCapabilities", "");
+ smart_objects::SmartObject audio_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ audio_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if (check_existing_json_member(audio_capabilities, "samplingRate")) {
+ audio_capabilities_so["samplingRate"] =
+ sampling_rate_enum.find(audio_capabilities.get("samplingRate", "")
+ .asString())->second;
+ }
+ if (check_existing_json_member(audio_capabilities, "bitsPerSample")) {
+ audio_capabilities_so["bitsPerSample"] =
+ bit_per_sample_enum.find(audio_capabilities.get("bitsPerSample",
+ "").asString())
+ ->second;
+ }
+ if (check_existing_json_member(audio_capabilities, "audioType")) {
+ audio_capabilities_so["audioType"] =
+ audio_type_enum.find(audio_capabilities.get("audioType", "")
+ .asString())->second;
+ }
+ set_audio_pass_thru_capabilities(audio_capabilities_so);
+ }
+
+ if (check_existing_json_member(ui, "pcmStreamCapabilities")) {
+ Json::Value pcm_capabilities = ui.get("pcmStreamCapabilities", "");
+ smart_objects::SmartObject pcm_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (check_existing_json_member(pcm_capabilities, "samplingRate")) {
+ pcm_capabilities_so["samplingRate"] =
+ sampling_rate_enum.find(pcm_capabilities.get("samplingRate", "")
+ .asString())->second;
+ }
+ if (check_existing_json_member(pcm_capabilities, "bitsPerSample")) {
+ pcm_capabilities_so["bitsPerSample"] =
+ bit_per_sample_enum.find(pcm_capabilities.get("bitsPerSample", "")
+ .asString())->second;
+ }
+ if (check_existing_json_member(pcm_capabilities, "audioType")) {
+ pcm_capabilities_so["audioType"] =
+ audio_type_enum.find(pcm_capabilities.get("audioType", "")
+ .asString())->second;
+ }
+
+ set_pcm_stream_capabilities(pcm_capabilities_so);
+ }
+
+ if (check_existing_json_member(ui, "hmiZoneCapabilities")) {
+ smart_objects::SmartObject hmi_zone_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ hmi_zone_capabilities_so =
+ hmi_zone_enum.find(ui.get("hmiZoneCapabilities", "").asString())
+ ->second;
+ set_hmi_zone_capabilities(hmi_zone_capabilities_so);
+ }
+
+ if (check_existing_json_member(ui, "softButtonCapabilities")) {
+ Json::Value soft_button_capabilities =
+ ui.get("softButtonCapabilities", "");
+ smart_objects::SmartObject soft_button_capabilities_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(
+ soft_button_capabilities, soft_button_capabilities_so);
+ set_soft_button_capabilities(soft_button_capabilities_so);
+ }
+ } // UI end
+
+ // VR
+ if (check_existing_json_member(root_json, "VR")) {
+ Json::Value vr = root_json.get("VR", "");
+ if (check_existing_json_member(vr, "language")) {
+ const std::string lang = vr.get("language", "EN-US").asString();
+ set_active_vr_language(MessageHelper::CommonLanguageFromString(lang));
+ } else {
+ set_active_vr_language(
+ MessageHelper::CommonLanguageFromString("EN-US"));
+ }
+
+ if (check_existing_json_member(vr, "languages")) {
+ Json::Value languages_vr = vr.get("languages", "");
+ smart_objects::SmartObject vr_languages_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ convert_json_languages_to_obj(languages_vr, vr_languages_so);
+ set_vr_supported_languages(vr_languages_so);
+ }
+
+ if (check_existing_json_member(vr, "capabilities")) {
+ Json::Value capabilities = vr.get("capabilities", "");
+ smart_objects::SmartObject vr_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (uint32_t i = 0; i < capabilities.size(); ++i) {
+ vr_capabilities_so[i] =
+ vr_enum_capabilities.find(capabilities[i].asString())->second;
+ }
+ set_vr_capabilities(vr_capabilities_so);
+ }
+ } // VR end
+
+ // TTS
+ if (check_existing_json_member(root_json, "TTS")) {
+ Json::Value tts = root_json.get("TTS", "");
+
+ if (check_existing_json_member(tts, "language")) {
+ const std::string lang = tts.get("language", "EN-US").asString();
+ set_active_tts_language(MessageHelper::CommonLanguageFromString(lang));
+ } else {
+ set_active_tts_language(
+ MessageHelper::CommonLanguageFromString("EN-US"));
+ }
+
+ if (check_existing_json_member(tts, "languages")) {
+ Json::Value languages_tts = tts.get("languages", "");
+ smart_objects::SmartObject tts_languages_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ convert_json_languages_to_obj(languages_tts, tts_languages_so);
+ set_tts_supported_languages(tts_languages_so);
+ }
+
+ if (check_existing_json_member(tts, "capabilities")) {
+ 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
+
+ // Buttons
+ if (check_existing_json_member(root_json, "Buttons")) {
+ Json::Value buttons = root_json.get("Buttons", "");
+ if (check_existing_json_member(buttons, "capabilities")) {
+ Json::Value bt_capabilities = buttons.get("capabilities", "");
+ smart_objects::SmartObject buttons_capabilities_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(bt_capabilities,
+ buttons_capabilities_so);
+
+ for (uint32_t i = 0; i < buttons_capabilities_so.length(); ++i) {
+ if ((buttons_capabilities_so[i]).keyExists(strings::name)) {
+ std::map<std::string,
+ hmi_apis::Common_ButtonName::eType>::const_iterator it =
+ button_enum_name.find(
+ (buttons_capabilities_so[i][strings::name]).asString());
+ buttons_capabilities_so[i].erase(strings::name);
+ if (button_enum_name.end() != it) {
+ buttons_capabilities_so[i][strings::name] = it->second;
+ }
+ }
+ }
+ set_button_capabilities(buttons_capabilities_so);
+ }
+ if (check_existing_json_member(buttons, "presetBankCapabilities")) {
+ Json::Value presetBank = buttons.get("presetBankCapabilities", "");
+ smart_objects::SmartObject preset_bank_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(presetBank,
+ preset_bank_so);
+ set_preset_bank_capabilities(preset_bank_so);
+ }
+ } // Buttons end
+
+ // VehicleType
+ if (check_existing_json_member(root_json, "VehicleInfo")) {
+ Json::Value vehicle_info = root_json.get("VehicleInfo", "");
+ smart_objects::SmartObject vehicle_type_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(vehicle_info,
+ vehicle_type_so);
+ set_vehicle_type(vehicle_type_so);
+ } // VehicleType end
+
+ } catch (...) {
+ return false;
+ }
+ return true;
+}
+
+void HMICapabilitiesImpl::set_ccpu_version(const std::string& ccpu_version) {
+ ccpu_version_ = ccpu_version;
+}
+
+const std::string& HMICapabilitiesImpl::ccpu_version() const {
+ return ccpu_version_;
+}
+
+bool HMICapabilitiesImpl::check_existing_json_member(
+ const Json::Value& json_member, const char* name_of_member) const {
+ return json_member.isMember(name_of_member);
+}
+
+void HMICapabilitiesImpl::convert_json_languages_to_obj(
+ const Json::Value& json_languages,
+ smart_objects::SmartObject& languages) const {
+ for (uint32_t i = 0, j = 0; i < json_languages.size(); ++i) {
+ languages[j++] =
+ MessageHelper::CommonLanguageFromString(json_languages[i].asString());
+ }
+}
+
+HMILanguageHandler& HMICapabilitiesImpl::get_hmi_language_handler() {
+ return hmi_language_handler_;
+}
+
+void HMICapabilitiesImpl::set_handle_response_for(
+ const smart_objects::SmartObject& request) {
+ hmi_language_handler_.set_handle_response_for(request);
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc
index 67625fde88..3f8a60a4a5 100644
--- a/src/components/application_manager/src/hmi_command_factory.cc
+++ b/src/components/application_manager/src/hmi_command_factory.cc
@@ -157,6 +157,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"
@@ -328,6 +333,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(
diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
new file mode 100644
index 0000000000..8a9944bec4
--- /dev/null
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/hmi_interfaces_impl.h"
+namespace application_manager {
+
+std::map<hmi_apis::FunctionID::eType, HmiInterfaces::InterfaceID>
+generate_function_to_interface_convert_map() {
+ using namespace hmi_apis::FunctionID;
+ std::map<hmi_apis::FunctionID::eType, HmiInterfaces::InterfaceID> convert_map;
+ convert_map[Buttons_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_Buttons;
+ convert_map[Buttons_OnButtonEvent] = HmiInterfaces::HMI_INTERFACE_Buttons;
+ convert_map[Buttons_OnButtonPress] = HmiInterfaces::HMI_INTERFACE_Buttons;
+ convert_map[Buttons_OnButtonSubscription] =
+ HmiInterfaces::HMI_INTERFACE_Buttons;
+ convert_map[BasicCommunication_OnReady] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnStartDeviceDiscovery] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnUpdateDeviceList] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnResumeAudioSource] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnSDLPersistenceComplete] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_UpdateAppList] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_UpdateDeviceList] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnFileRemoved] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_AllowDeviceToConnect] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnDeviceChosen] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnFindApplications] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_ActivateApp] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnAppActivated] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnAppDeactivated] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnAppRegistered] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnAppUnregistered] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnExitApplication] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnExitAllApplications] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnAwakeSDL] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_MixingAudioSupported] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_DialNumber] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnSystemRequest] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_SystemRequest] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_PolicyUpdate] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnSDLClose] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnPutFile] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_GetSystemInfo] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnSystemInfoChanged] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnIgnitionCycleOver] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_OnEventChanged] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[VR_IsReady] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_Started] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_Stopped] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_AddCommand] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_DeleteCommand] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_PerformInteraction] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_OnCommand] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_ChangeRegistration] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_OnLanguageChange] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_GetSupportedLanguages] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_GetLanguage] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[VR_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_VR;
+ convert_map[TTS_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_Started] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_Stopped] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_IsReady] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_Speak] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_StopSpeaking] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_ChangeRegistration] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_OnLanguageChange] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_GetSupportedLanguages] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_GetLanguage] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_SetGlobalProperties] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[TTS_OnResetTimeout] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[UI_Alert] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_Show] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_AddCommand] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_DeleteCommand] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_AddSubMenu] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_DeleteSubMenu] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_PerformInteraction] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_SetMediaClockTimer] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_SetGlobalProperties] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_OnCommand] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_OnSystemContext] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_ChangeRegistration] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_OnLanguageChange] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_GetSupportedLanguages] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_GetLanguage] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_OnDriverDistraction] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_SetAppIcon] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_SetDisplayLayout] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_ShowCustomForm] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_OnKeyboardInput] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_OnTouchEvent] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_Slider] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_ScrollableMessage] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_PerformAudioPassThru] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_EndAudioPassThru] = HmiInterfaces::HMI_INTERFACE_UI;
+ 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[Navigation_IsReady] = HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_SendLocation] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_ShowConstantTBT] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_AlertManeuver] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_UpdateTurnList] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_OnTBTClientState] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_StartStream] = HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_StopStream] = HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_StartAudioStream] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_StopAudioStream] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_OnAudioDataStreaming] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_OnVideoDataStreaming] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_GetWayPoints] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_OnWayPointChange] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_SubscribeWayPoints] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_UnsubscribeWayPoints] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[VehicleInfo_IsReady] = HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[VehicleInfo_GetVehicleType] =
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[VehicleInfo_ReadDID] = HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[VehicleInfo_GetDTCs] = HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[VehicleInfo_DiagnosticMessage] =
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[VehicleInfo_SubscribeVehicleData] =
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[VehicleInfo_UnsubscribeVehicleData] =
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[VehicleInfo_GetVehicleData] =
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[VehicleInfo_OnVehicleData] =
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo;
+ convert_map[SDL_ActivateApp] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_GetUserFriendlyMessage] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_OnAllowSDLFunctionality] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_OnReceivedPolicyUpdate] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_OnPolicyUpdate] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_GetListOfPermissions] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_OnAppPermissionConsent] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_OnAppPermissionChanged] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_OnSDLConsentNeeded] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_UpdateSDL] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_GetStatusUpdate] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_OnStatusUpdate] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_OnSystemError] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_AddStatisticsInfo] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[SDL_GetURLS] = HmiInterfaces::HMI_INTERFACE_SDL;
+ return convert_map;
+}
+
+HmiInterfacesImpl::HmiInterfacesImpl() {
+ sync_primitives::AutoLock autolock(interfaces_states_lock_);
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_BasicCommunication] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_Buttons] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_Navigation] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_SDL] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_TTS] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_UI] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_VehicleInfo] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_VR] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
+}
+
+HmiInterfaces::InterfaceState HmiInterfacesImpl::GetInterfaceState(
+ HmiInterfaces::InterfaceID interface) const {
+ sync_primitives::AutoLock autolock(interfaces_states_lock_);
+ const InterfaceStatesMap::const_iterator it =
+ interfaces_states_.find(interface);
+ // all interfaces should be presented in interfaces_states_ map.
+ DCHECK_OR_RETURN(it != interfaces_states_.end(), STATE_NOT_RESPONSE);
+ return it->second;
+}
+
+void HmiInterfacesImpl::SetInterfaceState(HmiInterfaces::InterfaceID interface,
+ HmiInterfaces::InterfaceState state) {
+ sync_primitives::AutoLock autolock(interfaces_states_lock_);
+ DCHECK(interfaces_states_.find(interface) != interfaces_states_.end());
+ interfaces_states_[interface] = state;
+}
+
+HmiInterfaces::InterfaceID HmiInterfacesImpl::GetInterfaceFromFunction(
+ hmi_apis::FunctionID::eType function) const {
+ // TODO(AKutsan): APPLINK-26874: Generate map of functionid to inteface
+ // automaticaly from
+ // HMI_API.xml
+ static const std::map<hmi_apis::FunctionID::eType, InterfaceID> convert_map =
+ generate_function_to_interface_convert_map();
+ const std::map<hmi_apis::FunctionID::eType, InterfaceID>::const_iterator it =
+ convert_map.find(function);
+ return it != convert_map.end() ? it->second : HMI_INTERFACE_INVALID_ENUM;
+}
+} // namespace application_manager
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..1f05232476 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -175,7 +175,7 @@ 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(app_id_) || is_voice_communication_app(app_id_)) {
return HMILevel::HMI_LIMITED;
}
return HMILevel::HMI_BACKGROUND;
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 08efba3d70..19bb658bca 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -38,6 +38,7 @@
#include <set>
#include <string>
+#include <strings.h>
#include <algorithm>
#include <utility>
#include <map>
@@ -69,6 +70,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 +99,96 @@ bool ValidateSoftButtons(smart_objects::SmartObject& soft_buttons) {
}
}
return true;
-} // namespace
}
+
+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, 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),
- 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),
- std::make_pair(strings::cluster_mode_status,
- VehicleDataType::CLUSTERMODESTATUS),
- std::make_pair(strings::my_key, VehicleDataType::MYKEY),
+ std::make_pair(strings::gps, GPS),
+ std::make_pair(strings::speed, SPEED),
+ std::make_pair(strings::rpm, RPM),
+ std::make_pair(strings::fuel_level, FUELLEVEL),
+ std::make_pair(strings::fuel_level_state, FUELLEVEL_STATE),
+ std::make_pair(strings::instant_fuel_consumption, FUELCONSUMPTION),
+ std::make_pair(strings::external_temp, EXTERNTEMP),
+ std::make_pair(strings::vin, VIN),
+ std::make_pair(strings::prndl, PRNDL),
+ std::make_pair(strings::tire_pressure, TIREPRESSURE),
+ std::make_pair(strings::odometer, ODOMETER),
+ std::make_pair(strings::belt_status, BELTSTATUS),
+ std::make_pair(strings::body_information, BODYINFO),
+ std::make_pair(strings::device_status, DEVICESTATUS),
+ std::make_pair(strings::driver_braking, BRAKING),
+ std::make_pair(strings::wiper_status, WIPERSTATUS),
+ std::make_pair(strings::head_lamp_status, HEADLAMPSTATUS),
+ std::make_pair(strings::e_call_info, ECALLINFO),
+ std::make_pair(strings::airbag_status, AIRBAGSTATUS),
+ std::make_pair(strings::emergency_event, EMERGENCYEVENT),
+ std::make_pair(strings::cluster_mode_status, CLUSTERMODESTATUS),
+ std::make_pair(strings::my_key, 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::steering_wheel_angle,
- VehicleDataType::STEERINGWHEEL),
+ std::make_pair(strings::engine_torque, ENGINETORQUE),
+ std::make_pair(strings::acc_pedal_pos, ACCPEDAL),
+ std::make_pair(strings::steering_wheel_angle, STEERINGWHEEL),
};
const VehicleData MessageHelper::vehicle_data_(
@@ -198,17 +256,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,6 +267,26 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
return hmi_apis::Common_Language::INVALID_ENUM;
}
+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::CreateRequestObject(
const uint32_t correlation_id) {
using namespace smart_objects;
@@ -251,6 +318,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 =
+ CreateRequestObject(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_);
@@ -369,7 +455,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(
@@ -1156,51 +1242,6 @@ void MessageHelper::SendUIChangeRegistrationRequestToHMI(
}
}
-void MessageHelper::SendChangeRegistrationRequestToHMI(
- ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
- if (!app.valid()) {
- return;
- }
- if (mobile_apis::Language::INVALID_ENUM != app->language()) {
- smart_objects::SmartObjectSPtr vr_command =
- CreateChangeRegistration(hmi_apis::FunctionID::VR_ChangeRegistration,
- app->language(),
- app->app_id(),
- NULL,
- app_mngr);
-
- if (vr_command) {
- app_mngr.ManageHMICommand(vr_command);
- }
- }
-
- if (mobile_apis::Language::INVALID_ENUM != app->language()) {
- smart_objects::SmartObjectSPtr tts_command =
- CreateChangeRegistration(hmi_apis::FunctionID::TTS_ChangeRegistration,
- app->language(),
- app->app_id(),
- NULL,
- app_mngr);
-
- if (tts_command) {
- app_mngr.ManageHMICommand(tts_command);
- }
- }
-
- if (mobile_apis::Language::INVALID_ENUM != app->ui_language()) {
- smart_objects::SmartObjectSPtr ui_command =
- CreateChangeRegistration(hmi_apis::FunctionID::UI_ChangeRegistration,
- app->ui_language(),
- app->app_id(),
- NULL,
- app_mngr);
-
- if (ui_command) {
- app_mngr.ManageHMICommand(ui_command);
- }
- }
-}
-
void MessageHelper::SendAddVRCommandToHMI(
const uint32_t cmd_id,
const smart_objects::SmartObject& vr_commands,
@@ -1497,8 +1538,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);
@@ -1523,7 +1565,7 @@ 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 =
@@ -1541,15 +1583,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;
@@ -1569,9 +1612,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) {
@@ -1580,51 +1628,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,
@@ -1831,12 +1929,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);
}
@@ -1890,16 +1991,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;
@@ -2224,7 +2323,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) {
@@ -2268,15 +2367,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,
@@ -2477,6 +2594,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_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
index 09d9512b19..b635cb1f84 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")
@@ -99,7 +99,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,7 +111,7 @@ 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());
@@ -200,19 +200,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 +225,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 +278,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/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 cf312acc6d..840b1ae0f8 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,7 @@
#include "utils/file_system.h"
#include "utils/scope_guard.h"
#include "utils/make_shared.h"
+#include "policy/policy_manager.h"
namespace policy {
@@ -112,7 +114,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 +150,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 +179,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 +205,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 +328,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 +340,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 +359,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 +387,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 +398,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,38 +413,60 @@ 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();
@@ -432,8 +486,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 +519,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 +536,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 +563,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 +668,180 @@ 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);
+
+ 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();
- MessageHelper::SendGetListOfPermissionsResponse(
- group_permissions, correlation_id, application_manager_);
+ 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_);
+
+ const uint32_t app_id = value->app_id();
+
+ if (!value->IsRegistered()) {
+ LOG4CXX_DEBUG(logger_,
+ "Application " << app_id << " is not marked as registered.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application " << 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::OnGetStatusUpdate(const uint32_t correlation_id) {
@@ -669,6 +855,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 +916,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 +1021,18 @@ bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK(false);
- uint32_t app_id = GetAppIdForSending();
+ ApplicationSharedPtr app;
+ uint32_t app_id = 0;
+ if (last_used_app_ids_.empty()) {
+ LOG4CXX_WARN(logger_, "last_used_app_ids_ is empty");
+ return false;
+ } else {
+ app_id = last_used_app_ids_.back();
- ApplicationSharedPtr app = application_manager_.application(app_id);
+ app = application_manager_.application(app_id);
+ }
- if (!app.valid()) {
+ if (!app) {
LOG4CXX_WARN(logger_,
"There is no registered application with "
"connection key '"
@@ -875,8 +1085,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 +1108,102 @@ 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;
+
+ if (kDefaultDeviceMacAddress == device_id) {
+ LOG4CXX_WARN(logger_,
+ "Device with id " << device_id << " wasn't found.");
+ continue;
+ }
+ policy_manager_->SetUserConsentForDevice(device_id, is_allowed);
+ uint32_t device_handle = 0;
+ if (!connection_handler.GetDeviceID(device_id, &device_handle)) {
+ LOG4CXX_WARN(logger_,
+ "Device handle with mac " << device_id
+ << " wasn't found.");
+ }
- 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;
+#ifdef EXTERNAL_PROPRIETARY_MODE
- 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.");
+ 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()));
+ } 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
+ uint32_t 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 +1218,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 +1278,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 +1343,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 +1428,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,30 +1444,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 {
@@ -1138,13 +1501,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(
@@ -1173,10 +1550,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_->GetServiceUrls(service_type, end_points);
+ 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_->GetUpdateUrls(service_type, out_end_points);
}
std::string PolicyHandler::GetLockScreenIconUrl() const {
@@ -1184,19 +1567,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() {
+ return TimeoutExchangeMSec() / date_time::DateTime::MILLISECONDS_IN_SECOND;
+}
+
+uint32_t PolicyHandler::TimeoutExchangeMSec() {
POLICY_LIB_CHECK(0);
- return policy_manager_->TimeoutExchange();
+ return policy_manager_->TimeoutExchangeMSec();
}
void PolicyHandler::OnExceededTimeout() {
@@ -1290,9 +1673,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) {
@@ -1300,6 +1760,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_);
+ HandlersCollection::const_iterator it = listeners_.begin();
+ std::for_each(
+ listeners_.begin(),
+ listeners_.end(),
+ std::bind2nd(std::mem_fun(&PolicyHandlerObserver::OnPTUFinished),
+ ptu_result));
+}
bool PolicyHandler::CanUpdate() {
return 0 != GetAppIdForSending();
@@ -1310,6 +1782,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) {
@@ -1363,7 +1846,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;
}
@@ -1371,14 +1854,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) {
@@ -1422,6 +1905,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);
@@ -1447,4 +1937,17 @@ 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);
+}
} // 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 b2ced9b01b..77a1853a39 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -49,17 +49,23 @@ 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::onTimer))
+ this, &RequestController::TimeoutThread))
+ , timer_stop_flag_(false)
, is_low_voltage_(false)
, settings_(settings) {
LOG4CXX_AUTO_TRACE(logger_);
InitializeThreadpool();
+ timer_.Start(0, timer::kSingleShot);
}
RequestController::~RequestController() {
LOG4CXX_AUTO_TRACE(logger_);
+ timer_stop_flag_ = true;
+ timer_condition_.Broadcast();
+ timer_.Stop();
if (pool_state_ != TPoolState::STOPPED) {
DestroyThreadpool();
}
@@ -96,42 +102,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;
}
@@ -166,7 +156,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);
@@ -202,7 +192,7 @@ RequestController::TResult RequestController::addHMIRequest(
LOG4CXX_DEBUG(logger_,
"Waiting for response count:" << waiting_for_response_.Size());
- UpdateTimer();
+ NotifyTimer();
return RequestController::SUCCESS;
}
@@ -219,45 +209,53 @@ 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,
- const uint32_t& connection_key,
+void RequestController::TerminateRequest(const uint32_t correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id,
bool force_terminate) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_,
"correlation_id = "
<< correlation_id << " connection_key = " << connection_key
+ << " function_id = " << function_id
<< " force_terminate = " << force_terminate);
RequestInfoPtr request =
waiting_for_response_.Find(connection_key, correlation_id);
- if (request) {
- if (force_terminate || request->request()->AllowedToTerminate()) {
- waiting_for_response_.RemoveRequest(request);
- } else {
- LOG4CXX_WARN(logger_, "Request was not terminated");
- }
- UpdateTimer();
+ if (!request) {
+ LOG4CXX_WARN(logger_, "Request was not found in waiting_for_response");
+ return;
+ }
+ if (request->request()->function_id() != function_id) {
+ LOG4CXX_ERROR(logger_, "Request and response function_id's don't match");
+ return;
+ }
+ if (force_terminate || request->request()->AllowedToTerminate()) {
+ waiting_for_response_.RemoveRequest(request);
} else {
- LOG4CXX_WARN(logger_, "Request not found in waiting_for_response_");
+ LOG4CXX_WARN(logger_, "Request was not terminated");
}
+ NotifyTimer();
}
-void RequestController::OnMobileResponse(const uint32_t& mobile_correlation_id,
- const uint32_t& connection_key) {
+void RequestController::OnMobileResponse(const uint32_t mobile_correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id) {
LOG4CXX_AUTO_TRACE(logger_);
- terminateRequest(mobile_correlation_id, connection_key);
+ TerminateRequest(mobile_correlation_id, connection_key, function_id);
}
-void RequestController::OnHMIResponse(const uint32_t& correlation_id) {
+void RequestController::OnHMIResponse(const uint32_t correlation_id,
+ const int32_t function_id) {
LOG4CXX_AUTO_TRACE(logger_);
- terminateRequest(correlation_id, RequestInfo::HmiConnectoinKey);
+ TerminateRequest(correlation_id, RequestInfo::HmiConnectoinKey, function_id);
}
void RequestController::terminateWaitingForExecutionAppRequests(
@@ -299,7 +297,7 @@ void RequestController::terminateAppRequests(const uint32_t& app_id) {
terminateWaitingForExecutionAppRequests(app_id);
terminateWaitingForResponseAppRequests(app_id);
- UpdateTimer();
+ NotifyTimer();
}
void RequestController::terminateAllHMIRequests() {
@@ -314,7 +312,7 @@ void RequestController::terminateAllMobileRequests() {
AutoLock waiting_execution_auto_lock(mobile_request_list_lock_);
mobile_request_list_.clear();
LOG4CXX_DEBUG(logger_, "Mobile Requests waiting for execution cleared");
- UpdateTimer();
+ NotifyTimer();
}
void RequestController::updateRequestTimeout(const uint32_t& app_id,
@@ -336,7 +334,7 @@ void RequestController::updateRequestTimeout(const uint32_t& app_id,
waiting_for_response_.RemoveRequest(request_info);
request_info->updateTimeOut(new_timeout);
waiting_for_response_.Add(request_info);
- UpdateTimer();
+ NotifyTimer();
LOG4CXX_INFO(logger_,
"Timeout updated for "
<< " app_id: " << app_id << " correlation_id: "
@@ -367,14 +365,40 @@ bool RequestController::IsLowVoltage() {
return is_low_voltage_;
}
-void RequestController::onTimer() {
+void RequestController::TimeoutThread() {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(
logger_,
"ENTER Waiting fore response count: " << waiting_for_response_.Size());
- RequestInfoPtr probably_expired =
- waiting_for_response_.FrontWithNotNullTimeout();
- while (probably_expired && probably_expired->isExpired()) {
+ 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;
+ }
+ if (!probably_expired->isExpired()) {
+ LOG4CXX_DEBUG(logger_,
+ "Timeout for "
+ << (RequestInfo::HMIRequest ==
+ probably_expired->requst_type()
+ ? "HMI"
+ : "Mobile")
+ << " 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) {
+ const uint32_t msecs = static_cast<uint32_t>(
+ date_time::DateTime::getmSecs(end_time - current_time));
+ LOG4CXX_DEBUG(logger_, "Sleep for " << msecs << " millisecs");
+ timer_condition_.WaitFor(auto_lock, msecs);
+ }
+ continue;
+ }
LOG4CXX_INFO(logger_,
"Timeout for "
<< (RequestInfo::HMIRequest ==
@@ -402,7 +426,6 @@ void RequestController::onTimer() {
}
}
}
- UpdateTimer();
LOG4CXX_DEBUG(
logger_,
"EXIT Waiting for response count : " << waiting_for_response_.Size());
@@ -453,7 +476,7 @@ void RequestController::Worker::threadMain() {
LOG4CXX_DEBUG(logger_, "timeout_in_mseconds " << timeout_in_mseconds);
if (0 != timeout_in_mseconds) {
- request_controller_->UpdateTimer();
+ request_controller_->NotifyTimer();
} else {
LOG4CXX_DEBUG(logger_,
"Default timeout was set to 0. "
@@ -481,37 +504,9 @@ void RequestController::Worker::exitThreadMain() {
// FIXME (dchmerev@luxoft.com): There is no waiting
}
-void RequestController::UpdateTimer() {
+void RequestController::NotifyTimer() {
LOG4CXX_AUTO_TRACE(logger_);
- RequestInfoPtr front = waiting_for_response_.FrontWithNotNullTimeout();
- // Buffer for sending request
- const uint32_t delay_time = 100u;
- if (front) {
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- TimevalStruct end_time = front->end_time();
- date_time::DateTime::AddMilliseconds(end_time, delay_time);
- if (current_time < end_time) {
- const uint32_t msecs = static_cast<uint32_t>(
- date_time::DateTime::getmSecs(end_time - current_time));
- LOG4CXX_DEBUG(logger_, "Sleep for " << msecs << " millisecs");
- // Timeout for bigger than 5 minutes is a mistake
- timer_.Start(msecs, true);
- } else {
- LOG4CXX_WARN(
- logger_,
- "Request app_id: "
- << front->app_id() << " correlation_id: " << front->requestId()
- << " is expired. "
- << "End time (ms): " << date_time::DateTime::getmSecs(end_time)
- << " Current time (ms): "
- << date_time::DateTime::getmSecs(current_time)
- << " Diff (current - end) (ms): "
- << date_time::DateTime::getmSecs(current_time - end_time)
- << " Request timeout (sec): "
- << front->timeout_msec() /
- date_time::DateTime::MILLISECONDS_IN_SECOND);
- }
- }
+ timer_condition_.NotifyOne();
}
} // namespace request_controller
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc
index d951d396d9..9a5828d939 100644
--- a/src/components/application_manager/src/request_info.cc
+++ b/src/components/application_manager/src/request_info.cc
@@ -77,10 +77,7 @@ RequestInfo::RequestInfo(RequestPtr request,
const RequestInfo::RequestType requst_type,
const TimevalStruct& start_time,
const uint64_t timeout_msec)
- : request_(request)
- , start_time_(start_time)
- , timeout_msec_(timeout_msec)
- , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM) {
+ : request_(request), start_time_(start_time), timeout_msec_(timeout_msec) {
updateEndTime();
requst_type_ = requst_type;
correlation_id_ = request_->correlation_id();
@@ -271,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.cc b/src/components/application_manager/src/resumption/resume_ctrl.cc
deleted file mode 100644
index 5e24c5572c..0000000000
--- a/src/components/application_manager/src/resumption/resume_ctrl.cc
+++ /dev/null
@@ -1,795 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/resumption/resume_ctrl.h"
-
-#include <fstream>
-#include <algorithm>
-
-#include "application_manager/application_manager.h"
-
-#include "utils/file_system.h"
-#include "connection_handler/connection_handler_impl.h"
-#include "application_manager/message_helper.h"
-#include "connection_handler/connection.h"
-#include "application_manager/commands/command_impl.h"
-#include "policy/policy_manager_impl.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/state_controller.h"
-#include "utils/helpers.h"
-#include "application_manager/resumption/resumption_data_db.h"
-#include "application_manager/resumption/resumption_data_json.h"
-#include "utils/make_shared.h"
-#include "utils/timer_task_impl.h"
-
-namespace resumption {
-using namespace application_manager;
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
-
-ResumeCtrl::ResumeCtrl(ApplicationManager& application_manager)
- : event_engine::EventObserver(application_manager.event_dispatcher())
- , queue_lock_(false)
- , restore_hmi_level_timer_(
- "RsmCtrlRstore",
- new timer::TimerTaskImpl<ResumeCtrl>(
- this, &ResumeCtrl::ApplicationResumptiOnTimer))
- , save_persistent_data_timer_("RsmCtrlPercist",
- new timer::TimerTaskImpl<ResumeCtrl>(
- this, &ResumeCtrl::SaveDataOnTimer))
- , is_resumption_active_(false)
- , is_data_saved_(false)
- , launch_time_(time(NULL))
- , application_manager_(application_manager) {}
-#ifdef BUILD_TESTS
-void ResumeCtrl::set_resumption_storage(
- utils::SharedPtr<ResumptionData> mock_storage) {
- resumption_storage_ = mock_storage;
-}
-#endif // BUILD_TESTS
-
-bool ResumeCtrl::Init(resumption::LastState& last_state) {
- bool use_db = application_manager_.get_settings().use_db_for_resumption();
- if (use_db) {
- resumption_storage_.reset(
- new ResumptionDataDB(In_File_Storage, application_manager_));
- if (!resumption_storage_->Init()) {
- return false;
- }
-
- ResumptionDataDB* db =
- dynamic_cast<ResumptionDataDB*>(resumption_storage_.get());
-
- if (!db->IsDBVersionActual()) {
- LOG4CXX_INFO(logger_,
- "DB version had been changed. "
- "Rebuilding resumption DB.");
-
- smart_objects::SmartObject data;
- db->GetAllData(data);
-
- if (!db->RefreshDB()) {
- return false;
- }
-
- db->SaveAllData(data);
- db->UpdateDBVersion();
- }
- } else {
- resumption_storage_.reset(
- new ResumptionDataJson(last_state, application_manager_));
- if (!resumption_storage_->Init()) {
- LOG4CXX_DEBUG(logger_, "Resumption storage initialisation failed");
- return false;
- }
- }
- LoadResumeData();
- save_persistent_data_timer_.Start(
- application_manager_.get_settings()
- .app_resumption_save_persistent_data_timeout(),
- false);
- return true;
-}
-
-ResumeCtrl::~ResumeCtrl() {}
-
-void ResumeCtrl::SaveAllApplications() {
- DataAccessor<ApplicationSet> accessor(application_manager_.applications());
- std::for_each(accessor.GetData().begin(),
- accessor.GetData().end(),
- std::bind1st(std::mem_fun(&ResumeCtrl::SaveApplication), this));
-}
-
-void ResumeCtrl::SaveApplication(ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(application);
- LOG4CXX_INFO(logger_,
- "application with appID " << application->app_id()
- << " will be saved");
- resumption_storage_->SaveApplication(application);
-}
-
-void ResumeCtrl::on_event(const event_engine::Event& event) {
- LOG4CXX_DEBUG(logger_, "Event received" << event.id());
-}
-
-bool ResumeCtrl::RestoreAppHMIState(ApplicationSharedPtr application) {
- using namespace mobile_apis;
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(application, false);
- LOG4CXX_DEBUG(logger_,
- "app_id : " << application->app_id() << "; policy_app_id : "
- << application->policy_app_id());
- const std::string& device_mac = application->mac_address();
- smart_objects::SmartObject saved_app(smart_objects::SmartType_Map);
- bool result = resumption_storage_->GetSavedApplication(
- application->policy_app_id(), device_mac, saved_app);
- if (result) {
- DCHECK_OR_RETURN(application, false);
- if (saved_app.keyExists(strings::hmi_level)) {
- const HMILevel::eType saved_hmi_level =
- static_cast<mobile_apis::HMILevel::eType>(
- saved_app[strings::hmi_level].asInt());
- LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
- return SetAppHMIState(application, saved_hmi_level, true);
- } else {
- result = false;
- LOG4CXX_ERROR(logger_, "saved app data corrupted");
- }
- } else {
- LOG4CXX_ERROR(logger_, "Application not saved");
- }
- return result;
-}
-
-bool ResumeCtrl::SetupDefaultHMILevel(ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(application, false);
- mobile_apis::HMILevel::eType default_hmi =
- application_manager_.GetDefaultHmiLevel(application);
- return SetAppHMIState(application, default_hmi, false);
-}
-
-void ResumeCtrl::ApplicationResumptiOnTimer() {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock auto_lock(queue_lock_);
- WaitingForTimerList::iterator it = waiting_for_timer_.begin();
-
- for (; it != waiting_for_timer_.end(); ++it) {
- ApplicationSharedPtr app = application_manager_.application(*it);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid app_id = " << *it);
- continue;
- }
- StartAppHmiStateResumption(app);
- }
- is_resumption_active_ = false;
- waiting_for_timer_.clear();
- StartSavePersistentDataTimer();
-}
-
-void ResumeCtrl::OnAppActivated(ApplicationSharedPtr application) {
- if (is_resumption_active_) {
- RemoveFromResumption(application->app_id());
- }
-}
-
-void ResumeCtrl::RemoveFromResumption(uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- queue_lock_.Acquire();
- waiting_for_timer_.remove(app_id);
- queue_lock_.Release();
-}
-
-bool ResumeCtrl::SetAppHMIState(ApplicationSharedPtr application,
- const mobile_apis::HMILevel::eType hmi_level,
- bool check_policy) {
- using namespace mobile_apis;
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(application, false);
- LOG4CXX_TRACE(logger_,
- " app_id : " << application->app_id()
- << ", hmi_level : " << hmi_level
- << ", check_policy : " << check_policy);
- const std::string& device_mac = application->mac_address();
- if (check_policy &&
- application_manager_.GetUserConsentForDevice(device_mac) !=
- policy::DeviceConsent::kDeviceAllowed) {
- LOG4CXX_ERROR(logger_, "Resumption abort. Data consent wasn't allowed.");
- SetupDefaultHMILevel(application);
- return false;
- }
- application->set_is_resuming(true);
- application_manager_.state_controller().SetRegularState(application,
- hmi_level);
- LOG4CXX_INFO(logger_,
- "Application with policy id " << application->policy_app_id()
- << " got HMI level " << hmi_level);
- return true;
-}
-
-bool ResumeCtrl::IsHMIApplicationIdExist(uint32_t hmi_app_id) {
- LOG4CXX_DEBUG(logger_, "hmi_app_id :" << hmi_app_id);
- return resumption_storage_->IsHMIApplicationIdExist(hmi_app_id);
-}
-
-bool ResumeCtrl::IsApplicationSaved(const std::string& policy_app_id,
- const std::string& device_id) {
- return -1 !=
- resumption_storage_->IsApplicationSaved(policy_app_id, device_id);
-}
-
-uint32_t ResumeCtrl::GetHMIApplicationID(const std::string& policy_app_id,
- const std::string& device_mac) const {
- return resumption_storage_->GetHMIApplicationID(policy_app_id, device_mac);
-}
-
-bool ResumeCtrl::RemoveApplicationFromSaved(
- ApplicationConstSharedPtr application) {
- const std::string& device_mac = application->mac_address();
- return resumption_storage_->RemoveApplicationFromSaved(
- application->policy_app_id(), device_mac);
-}
-
-void ResumeCtrl::OnSuspend() {
- LOG4CXX_AUTO_TRACE(logger_);
- StopSavePersistentDataTimer();
- SaveAllApplications();
- resumption_storage_->OnSuspend();
- resumption_storage_->Persist();
-}
-
-void ResumeCtrl::OnAwake() {
- ResetLaunchTime();
- StartSavePersistentDataTimer();
- return resumption_storage_->OnAwake();
-}
-
-void ResumeCtrl::StartSavePersistentDataTimer() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!save_persistent_data_timer_.is_running()) {
- save_persistent_data_timer_.Start(
- application_manager_.get_settings()
- .app_resumption_save_persistent_data_timeout(),
- false);
- }
-}
-
-void ResumeCtrl::StopSavePersistentDataTimer() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (save_persistent_data_timer_.is_running()) {
- save_persistent_data_timer_.Stop();
- }
-}
-
-bool ResumeCtrl::StartResumption(ApplicationSharedPtr application,
- const std::string& hash) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(application, false);
- LOG4CXX_DEBUG(
- logger_,
- " Resume app_id = " << application->app_id()
- << " hmi_app_id = " << application->hmi_app_id()
- << " policy_id = " << application->policy_app_id()
- << " received hash = " << hash);
- SetupDefaultHMILevel(application);
- smart_objects::SmartObject saved_app;
- const std::string& device_mac = application->mac_address();
- bool result = resumption_storage_->GetSavedApplication(
- application->policy_app_id(), device_mac, saved_app);
- if (result) {
- const std::string& saved_hash = saved_app[strings::hash_id].asString();
- result = saved_hash == hash ? RestoreApplicationData(application) : false;
- application->UpdateHash();
- AddToResumptionTimerQueue(application->app_id());
- }
- return result;
-}
-
-bool ResumeCtrl::StartResumptionOnlyHMILevel(ApplicationSharedPtr application) {
- // sync_primitives::AutoLock lock(resumtion_lock_);
- LOG4CXX_AUTO_TRACE(logger_);
- if (!application) {
- LOG4CXX_WARN(logger_, "Application does not exist.");
- return false;
- }
- LOG4CXX_DEBUG(logger_,
- "HMI level resumption requested for application id "
- << application->app_id() << "with hmi_app_id "
- << application->hmi_app_id() << ", policy_app_id "
- << application->policy_app_id());
- SetupDefaultHMILevel(application);
- const std::string& device_mac = application->mac_address();
- smart_objects::SmartObject saved_app;
- bool result = resumption_storage_->GetSavedApplication(
- application->policy_app_id(), device_mac, saved_app);
- if (result) {
- // sync_primitives::AutoUnlock unlock(lock);
- AddToResumptionTimerQueue(application->app_id());
- }
- LOG4CXX_INFO(logger_, "StartResumptionOnlyHMILevel::Result = " << result);
- return result;
-}
-
-void ResumeCtrl::StartAppHmiStateResumption(ApplicationSharedPtr application) {
- using namespace date_time;
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(application);
- smart_objects::SmartObject saved_app;
- const std::string& device_mac = application->mac_address();
- bool result = resumption_storage_->GetSavedApplication(
- application->policy_app_id(), device_mac, saved_app);
- DCHECK_OR_RETURN_VOID(result);
- const uint32_t ign_off_count = saved_app[strings::ign_off_count].asUInt();
- bool restore_data_allowed = false;
- restore_data_allowed =
- CheckAppRestrictions(application, saved_app) &&
- ((0 == ign_off_count) || CheckIgnCycleRestrictions(saved_app));
- if (restore_data_allowed) {
- LOG4CXX_INFO(logger_,
- "Resume application " << application->policy_app_id());
- RestoreAppHMIState(application);
- RemoveApplicationFromSaved(application);
- } else {
- LOG4CXX_INFO(logger_,
- "Do not need to resume application "
- << application->policy_app_id());
- }
-}
-
-void ResumeCtrl::ResetLaunchTime() {
- LOG4CXX_AUTO_TRACE(logger_);
- launch_time_ = time(NULL);
-}
-
-bool ResumeCtrl::CheckPersistenceFilesForResumption(
- ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(application, false);
- LOG4CXX_DEBUG(logger_,
- " Resume app_id = " << application->app_id() << " policy_id = "
- << application->policy_app_id());
- smart_objects::SmartObject saved_app;
- const std::string& device_mac = application->mac_address();
- bool result = resumption_storage_->GetSavedApplication(
- application->policy_app_id(), device_mac, saved_app);
- if (result) {
- if (saved_app.keyExists(strings::application_commands)) {
- if (!CheckIcons(application, saved_app[strings::application_commands])) {
- return false;
- }
- }
- if (saved_app.keyExists(strings::application_choice_sets)) {
- if (!CheckIcons(application,
- saved_app[strings::application_choice_sets])) {
- return false;
- }
- }
- }
- return true;
-}
-
-bool ResumeCtrl::CheckApplicationHash(ApplicationSharedPtr application,
- const std::string& hash) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(application, false);
- LOG4CXX_DEBUG(logger_,
- "app_id : " << application->app_id() << " hash : " << hash);
- smart_objects::SmartObject saved_app;
- const std::string& device_mac = application->mac_address();
- bool result = resumption_storage_->GetSavedApplication(
- application->policy_app_id(), device_mac, saved_app);
- return result ? saved_app[strings::hash_id].asString() == hash : false;
-}
-
-void ResumeCtrl::SaveDataOnTimer() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (is_resumption_active_) {
- LOG4CXX_WARN(logger_, "Resumption timer is active skip saving");
- return;
- }
-
- if (false == is_data_saved_) {
- SaveAllApplications();
- is_data_saved_ = true;
- if (!application_manager_.get_settings().use_db_for_resumption()) {
- resumption_storage_->Persist();
- }
- }
-}
-
-bool ResumeCtrl::IsDeviceMacAddressEqual(ApplicationSharedPtr application,
- const std::string& saved_device_mac) {
- LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_mac = application->mac_address();
- return device_mac == saved_device_mac;
-}
-
-bool ResumeCtrl::RestoreApplicationData(ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(application, false);
- LOG4CXX_DEBUG(logger_, "app_id : " << application->app_id());
-
- smart_objects::SmartObject saved_app(smart_objects::SmartType_Map);
- const std::string& device_mac = application->mac_address();
- bool result = resumption_storage_->GetSavedApplication(
- application->policy_app_id(), device_mac, saved_app);
- if (result) {
- if (saved_app.keyExists(strings::grammar_id)) {
- const uint32_t app_grammar_id = saved_app[strings::grammar_id].asUInt();
- application->set_grammar_id(app_grammar_id);
- AddFiles(application, saved_app);
- AddSubmenues(application, saved_app);
- AddCommands(application, saved_app);
- AddChoicesets(application, saved_app);
- SetGlobalProperties(application, saved_app);
- AddSubscriptions(application, saved_app);
- AddWayPointsSubscription(application, saved_app);
- result = true;
- } else {
- LOG4CXX_WARN(logger_,
- "Saved data of application does not contain grammar_id");
- result = false;
- }
- } else {
- LOG4CXX_WARN(logger_, "Application not saved");
- }
- return result;
-}
-
-void ResumeCtrl::AddFiles(ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (saved_app.keyExists(strings::application_files)) {
- const smart_objects::SmartObject& application_files =
- saved_app[strings::application_files];
- for (size_t i = 0; i < application_files.length(); ++i) {
- const smart_objects::SmartObject& file_data = application_files[i];
- const bool is_persistent =
- file_data.keyExists(strings::persistent_file) &&
- file_data[strings::persistent_file].asBool();
- if (is_persistent) {
- AppFile file;
- file.is_persistent = is_persistent;
- file.is_download_complete =
- file_data[strings::is_download_complete].asBool();
- file.file_name = file_data[strings::sync_file_name].asString();
- file.file_type = static_cast<mobile_apis::FileType::eType>(
- file_data[strings::file_type].asInt());
- application->AddFile(file);
- }
- }
- } else {
- LOG4CXX_FATAL(logger_, "application_files section is not exists");
- }
-}
-
-void ResumeCtrl::AddSubmenues(ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (saved_app.keyExists(strings::application_submenus)) {
- const smart_objects::SmartObject& app_submenus =
- saved_app[strings::application_submenus];
- for (size_t i = 0; i < app_submenus.length(); ++i) {
- const smart_objects::SmartObject& submenu = app_submenus[i];
- application->AddSubMenu(submenu[strings::menu_id].asUInt(), submenu);
- }
- ProcessHMIRequests(MessageHelper::CreateAddSubMenuRequestToHMI(
- application, application_manager_.GetNextHMICorrelationID()));
- } else {
- LOG4CXX_FATAL(logger_, "application_submenus section is not exists");
- }
-}
-
-void ResumeCtrl::AddCommands(ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (saved_app.keyExists(strings::application_commands)) {
- const smart_objects::SmartObject& app_commands =
- saved_app[strings::application_commands];
- for (size_t i = 0; i < app_commands.length(); ++i) {
- const smart_objects::SmartObject& command = app_commands[i];
-
- application->AddCommand(command[strings::cmd_id].asUInt(), command);
- }
- ProcessHMIRequests(MessageHelper::CreateAddCommandRequestToHMI(
- application, application_manager_));
- } else {
- LOG4CXX_FATAL(logger_, "application_commands section is not exists");
- }
-}
-
-void ResumeCtrl::AddChoicesets(ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (saved_app.keyExists(strings::application_choice_sets)) {
- const smart_objects::SmartObject& app_choice_sets =
- saved_app[strings::application_choice_sets];
- for (size_t i = 0; i < app_choice_sets.length(); ++i) {
- const smart_objects::SmartObject& choice_set = app_choice_sets[i];
- const int32_t choice_set_id =
- choice_set[strings::interaction_choice_set_id].asInt();
- application->AddChoiceSet(choice_set_id, choice_set);
- }
- ProcessHMIRequests(MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(
- application, application_manager_));
- } else {
- LOG4CXX_FATAL(logger_, "There is no any choicesets");
- }
-}
-
-void ResumeCtrl::SetGlobalProperties(
- ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (saved_app.keyExists(strings::application_global_properties)) {
- const smart_objects::SmartObject& properties_so =
- saved_app[strings::application_global_properties];
- application->load_global_properties(properties_so);
- MessageHelper::SendGlobalPropertiesToHMI(application, application_manager_);
- }
-}
-
-void ResumeCtrl::AddWayPointsSubscription(
- app_mngr::ApplicationSharedPtr application,
- const smart_objects::SmartObject& saved_app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (saved_app.keyExists(strings::subscribed_for_way_points)) {
- 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());
- }
- }
-}
-
-void ResumeCtrl::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 (subscribtions.keyExists(strings::application_buttons)) {
- const smart_objects::SmartObject& subscribtions_buttons =
- subscribtions[strings::application_buttons];
- mobile_apis::ButtonName::eType btn;
- for (size_t i = 0; i < subscribtions_buttons.length(); ++i) {
- btn = static_cast<mobile_apis::ButtonName::eType>(
- (subscribtions_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());
- application->SubscribeToIVI(ivi);
- }
- ProcessHMIRequests(MessageHelper::GetIVISubscriptionRequests(
- application, application_manager_));
- }
- }
-}
-
-bool ResumeCtrl::CheckIgnCycleRestrictions(
- const smart_objects::SmartObject& saved_app) {
- LOG4CXX_AUTO_TRACE(logger_);
- bool result = true;
-
- if (!CheckDelayAfterIgnOn()) {
- LOG4CXX_INFO(logger_, "Application was connected long after ign on");
- result = false;
- }
-
- if (!DisconnectedJustBeforeIgnOff(saved_app)) {
- LOG4CXX_INFO(logger_, "Application was dissconnected long before ign off");
- result = false;
- }
- return result;
-}
-
-bool ResumeCtrl::DisconnectedJustBeforeIgnOff(
- const smart_objects::SmartObject& saved_app) {
- using namespace date_time;
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
-
- const time_t time_stamp =
- static_cast<time_t>(saved_app[strings::time_stamp].asUInt());
- 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);
- LOG4CXX_DEBUG(
- logger_,
- "ign_off_time "
- << ign_off_time << "; app_disconnect_time " << time_stamp
- << "; sec_spent_before_ign " << sec_spent_before_ign
- << "; resumption_delay_before_ign "
- << application_manager_.get_settings().resumption_delay_before_ign());
- return sec_spent_before_ign <=
- application_manager_.get_settings().resumption_delay_before_ign();
-}
-
-bool ResumeCtrl::CheckAppRestrictions(
- ApplicationConstSharedPtr application,
- const smart_objects::SmartObject& saved_app) {
- using namespace mobile_apis;
- using namespace helpers;
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(saved_app.keyExists(strings::hmi_level), false);
-
- const bool is_media_app = application->is_media_application();
- const HMILevel::eType hmi_level =
- static_cast<HMILevel::eType>(saved_app[strings::hmi_level].asInt());
- const bool result = Compare<HMILevel::eType, EQ, ONE>(
- hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)
- ? true
- : false;
- LOG4CXX_DEBUG(logger_,
- "is_media_app " << is_media_app << "; hmi_level " << hmi_level
- << " result " << result);
- return result;
-}
-
-bool ResumeCtrl::CheckIcons(ApplicationSharedPtr application,
- smart_objects::SmartObject& obj) {
- using namespace smart_objects;
- LOG4CXX_AUTO_TRACE(logger_);
- const mobile_apis::Result::eType verify_images =
- MessageHelper::VerifyImageFiles(obj, application, application_manager_);
- return mobile_apis::Result::INVALID_DATA != verify_images;
-}
-
-bool ResumeCtrl::CheckDelayAfterIgnOn() {
- using namespace date_time;
- LOG4CXX_AUTO_TRACE(logger_);
- const time_t curr_time = time(NULL);
- const time_t sdl_launch_time = launch_time();
- const uint32_t seconds_from_sdl_start = labs(curr_time - sdl_launch_time);
- const uint32_t wait_time =
- application_manager_.get_settings().resumption_delay_after_ign();
- LOG4CXX_DEBUG(logger_,
- "curr_time " << curr_time << "; sdl_launch_time "
- << sdl_launch_time << "; seconds_from_sdl_start "
- << seconds_from_sdl_start << "; wait_time "
- << wait_time);
- return seconds_from_sdl_start <= wait_time;
-}
-
-time_t ResumeCtrl::launch_time() const {
- return launch_time_;
-}
-
-time_t ResumeCtrl::GetIgnOffTime() {
- return resumption_storage_->GetIgnOffTime();
-}
-
-bool ResumeCtrl::ProcessHMIRequest(smart_objects::SmartObjectSPtr request,
- bool use_events) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (use_events) {
- const hmi_apis::FunctionID::eType function_id =
- static_cast<hmi_apis::FunctionID::eType>(
- (*request)[strings::function_id].asInt());
-
- const int32_t hmi_correlation_id =
- (*request)[strings::correlation_id].asInt();
- subscribe_on_event(function_id, hmi_correlation_id);
- }
- if (!application_manager_.ManageHMICommand(request)) {
- LOG4CXX_ERROR(logger_, "Unable to send request");
- return false;
- }
- return true;
-}
-
-void ResumeCtrl::ProcessHMIRequests(
- const smart_objects::SmartObjectList& requests) {
- for (smart_objects::SmartObjectList::const_iterator it = requests.begin(),
- total = requests.end();
- it != total;
- ++it) {
- ProcessHMIRequest(*it, true);
- }
-}
-
-void ResumeCtrl::AddToResumptionTimerQueue(const uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- queue_lock_.Acquire();
- waiting_for_timer_.push_back(app_id);
- queue_lock_.Release();
- LOG4CXX_DEBUG(logger_,
- "Application ID " << app_id << " have been added"
- " to resumption queue.");
- if (!is_resumption_active_) {
- is_resumption_active_ = true;
- restore_hmi_level_timer_.Start(
- application_manager_.get_settings().app_resuming_timeout(), true);
- }
-}
-
-void ResumeCtrl::LoadResumeData() {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject so_applications_data;
- resumption_storage_->GetDataForLoadResumeData(so_applications_data);
- size_t length = so_applications_data.length();
- for (size_t i = 0; i < length; ++i) {
- smart_objects::SmartObject& application = so_applications_data[i];
- if (IsAppDataResumptionExpired(application)) {
- const std::string device_id = application[strings::device_id].asString();
- const std::string app_id = application[strings::app_id].asString();
- LOG4CXX_INFO(logger_, "Data resumption is expired.");
- LOG4CXX_DEBUG(logger_,
- "Resumption data for application "
- << app_id << " and device id " << device_id
- << " will be dropped.");
- resumption_storage_->DropAppDataResumption(device_id, app_id);
- continue;
- }
- }
-}
-
-void ResumeCtrl::OnAppRegistrationStart(const std::string& policy_app_id,
- const std::string& device_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (IsApplicationSaved(policy_app_id, device_id)) {
- LOG4CXX_INFO(
- logger_,
- "Application is found in resumption "
- "data and will try to resume. Stopping resume data persistent timer");
- StopSavePersistentDataTimer();
- }
-}
-
-void ResumeCtrl::OnAppRegistrationEnd() {
- LOG4CXX_AUTO_TRACE(logger_);
- StartSavePersistentDataTimer();
-}
-
-bool ResumeCtrl::IsAppDataResumptionExpired(
- const smart_objects::SmartObject& application) const {
- const int32_t max_ign_off_count = 3;
- return max_ign_off_count <= application[strings::ign_off_count].asInt();
-}
-
-} // namespce resumption
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
new file mode 100644
index 0000000000..ad50bbf104
--- /dev/null
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -0,0 +1,815 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/resumption/resume_ctrl_impl.h"
+
+#include <fstream>
+#include <algorithm>
+
+#include "application_manager/application_manager.h"
+
+#include "utils/file_system.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "application_manager/message_helper.h"
+#include "connection_handler/connection.h"
+#include "application_manager/commands/command_impl.h"
+#include "policy/policy_manager_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/state_controller.h"
+#include "utils/helpers.h"
+#include "application_manager/resumption/resumption_data_db.h"
+#include "application_manager/resumption/resumption_data_json.h"
+#include "utils/make_shared.h"
+#include "utils/timer_task_impl.h"
+
+namespace resumption {
+using namespace application_manager;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
+
+ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager)
+ : event_engine::EventObserver(application_manager.event_dispatcher())
+ , queue_lock_(false)
+ , restore_hmi_level_timer_(
+ "RsmCtrlRstore",
+ new timer::TimerTaskImpl<ResumeCtrlImpl>(
+ this, &ResumeCtrlImpl::ApplicationResumptiOnTimer))
+ , save_persistent_data_timer_("RsmCtrlPercist",
+ new timer::TimerTaskImpl<ResumeCtrlImpl>(
+ this, &ResumeCtrlImpl::SaveDataOnTimer))
+ , is_resumption_active_(false)
+ , is_data_saved_(false)
+ , launch_time_(time(NULL))
+ , application_manager_(application_manager) {}
+#ifdef BUILD_TESTS
+void ResumeCtrlImpl::set_resumption_storage(
+ utils::SharedPtr<ResumptionData> mock_storage) {
+ resumption_storage_ = mock_storage;
+}
+#endif // BUILD_TESTS
+
+bool ResumeCtrlImpl::Init(resumption::LastState& last_state) {
+ bool use_db = application_manager_.get_settings().use_db_for_resumption();
+ if (use_db) {
+ resumption_storage_.reset(
+ new ResumptionDataDB(In_File_Storage, application_manager_));
+ if (!resumption_storage_->Init()) {
+ return false;
+ }
+
+ ResumptionDataDB* db =
+ dynamic_cast<ResumptionDataDB*>(resumption_storage_.get());
+
+ if (!db->IsDBVersionActual()) {
+ LOG4CXX_INFO(logger_,
+ "DB version had been changed. "
+ "Rebuilding resumption DB.");
+
+ smart_objects::SmartObject data;
+ db->GetAllData(data);
+
+ if (!db->RefreshDB()) {
+ return false;
+ }
+
+ db->SaveAllData(data);
+ db->UpdateDBVersion();
+ }
+ } else {
+ resumption_storage_.reset(
+ new ResumptionDataJson(last_state, application_manager_));
+ if (!resumption_storage_->Init()) {
+ LOG4CXX_DEBUG(logger_, "Resumption storage initialisation failed");
+ return false;
+ }
+ }
+ LoadResumeData();
+ save_persistent_data_timer_.Start(
+ application_manager_.get_settings()
+ .app_resumption_save_persistent_data_timeout(),
+ timer::kPeriodic);
+ return true;
+}
+
+ResumeCtrlImpl::~ResumeCtrlImpl() {}
+
+void ResumeCtrlImpl::SaveAllApplications() {
+ DataAccessor<ApplicationSet> accessor(application_manager_.applications());
+ std::for_each(
+ accessor.GetData().begin(),
+ accessor.GetData().end(),
+ std::bind1st(std::mem_fun(&ResumeCtrlImpl::SaveApplication), this));
+}
+
+void ResumeCtrlImpl::SaveApplication(ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+ LOG4CXX_INFO(logger_,
+ "application with appID " << application->app_id()
+ << " will be saved");
+ resumption_storage_->SaveApplication(application);
+}
+
+void ResumeCtrlImpl::on_event(const event_engine::Event& event) {
+ LOG4CXX_DEBUG(logger_, "Event received" << event.id());
+}
+
+bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(application, false);
+ LOG4CXX_DEBUG(logger_,
+ "app_id : " << application->app_id() << "; policy_app_id : "
+ << application->policy_app_id());
+ const std::string& device_mac = application->mac_address();
+ smart_objects::SmartObject saved_app(smart_objects::SmartType_Map);
+ bool result = resumption_storage_->GetSavedApplication(
+ application->policy_app_id(), device_mac, saved_app);
+ if (result) {
+ DCHECK_OR_RETURN(application, false);
+ if (saved_app.keyExists(strings::hmi_level)) {
+ const HMILevel::eType saved_hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ saved_app[strings::hmi_level].asInt());
+ LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
+ return SetAppHMIState(application, saved_hmi_level, true);
+ } else {
+ result = false;
+ LOG4CXX_ERROR(logger_, "saved app data corrupted");
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Application not saved");
+ }
+ return result;
+}
+
+bool ResumeCtrlImpl::SetupDefaultHMILevel(ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(application, false);
+ mobile_apis::HMILevel::eType default_hmi =
+ application_manager_.GetDefaultHmiLevel(application);
+ return SetAppHMIState(application, default_hmi, false);
+}
+
+void ResumeCtrlImpl::ApplicationResumptiOnTimer() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ WaitingForTimerList::iterator it = waiting_for_timer_.begin();
+
+ for (; it != waiting_for_timer_.end(); ++it) {
+ ApplicationSharedPtr app = application_manager_.application(*it);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id = " << *it);
+ continue;
+ }
+ StartAppHmiStateResumption(app);
+ }
+ is_resumption_active_ = false;
+ waiting_for_timer_.clear();
+ StartSavePersistentDataTimer();
+}
+
+void ResumeCtrlImpl::OnAppActivated(ApplicationSharedPtr application) {
+ if (is_resumption_active_) {
+ RemoveFromResumption(application->app_id());
+ }
+}
+
+void ResumeCtrlImpl::RemoveFromResumption(uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ queue_lock_.Acquire();
+ waiting_for_timer_.remove(app_id);
+ queue_lock_.Release();
+}
+
+bool ResumeCtrlImpl::SetAppHMIState(
+ ApplicationSharedPtr application,
+ const mobile_apis::HMILevel::eType hmi_level,
+ bool check_policy) {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(application, false);
+ LOG4CXX_TRACE(logger_,
+ " app_id : " << application->app_id()
+ << ", hmi_level : " << hmi_level
+ << ", check_policy : " << check_policy);
+ const std::string& device_mac = application->mac_address();
+ if (check_policy &&
+ application_manager_.GetUserConsentForDevice(device_mac) !=
+ policy::DeviceConsent::kDeviceAllowed) {
+ LOG4CXX_ERROR(logger_, "Resumption abort. Data consent wasn't allowed.");
+ SetupDefaultHMILevel(application);
+ return false;
+ }
+ application->set_is_resuming(true);
+ application_manager_.state_controller().SetRegularState(application,
+ hmi_level);
+ LOG4CXX_INFO(logger_,
+ "Application with policy id " << application->policy_app_id()
+ << " got HMI level " << hmi_level);
+ return true;
+}
+
+bool ResumeCtrlImpl::IsHMIApplicationIdExist(uint32_t hmi_app_id) {
+ LOG4CXX_DEBUG(logger_, "hmi_app_id :" << hmi_app_id);
+ return resumption_storage_->IsHMIApplicationIdExist(hmi_app_id);
+}
+
+bool ResumeCtrlImpl::IsApplicationSaved(const std::string& policy_app_id,
+ const std::string& device_id) {
+ return -1 !=
+ resumption_storage_->IsApplicationSaved(policy_app_id, device_id);
+}
+
+uint32_t ResumeCtrlImpl::GetHMIApplicationID(
+ const std::string& policy_app_id, const std::string& device_mac) const {
+ return resumption_storage_->GetHMIApplicationID(policy_app_id, device_mac);
+}
+
+bool ResumeCtrlImpl::RemoveApplicationFromSaved(
+ ApplicationConstSharedPtr application) {
+ const std::string& device_mac = application->mac_address();
+ return resumption_storage_->RemoveApplicationFromSaved(
+ application->policy_app_id(), device_mac);
+}
+
+void ResumeCtrlImpl::OnSuspend() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ StopSavePersistentDataTimer();
+ SaveAllApplications();
+ resumption_storage_->OnSuspend();
+ resumption_storage_->Persist();
+}
+
+void ResumeCtrlImpl::OnAwake() {
+ ResetLaunchTime();
+ StartSavePersistentDataTimer();
+ return resumption_storage_->OnAwake();
+}
+
+void ResumeCtrlImpl::StartSavePersistentDataTimer() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!save_persistent_data_timer_.is_running()) {
+ save_persistent_data_timer_.Start(
+ application_manager_.get_settings()
+ .app_resumption_save_persistent_data_timeout(),
+ timer::kPeriodic);
+ }
+}
+
+void ResumeCtrlImpl::StopSavePersistentDataTimer() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (save_persistent_data_timer_.is_running()) {
+ save_persistent_data_timer_.Stop();
+ }
+}
+
+bool ResumeCtrlImpl::StartResumption(ApplicationSharedPtr application,
+ const std::string& hash) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(application, false);
+ LOG4CXX_DEBUG(
+ logger_,
+ " Resume app_id = " << application->app_id()
+ << " hmi_app_id = " << application->hmi_app_id()
+ << " policy_id = " << application->policy_app_id()
+ << " received hash = " << hash);
+ SetupDefaultHMILevel(application);
+ smart_objects::SmartObject saved_app;
+ const std::string& device_mac = application->mac_address();
+ bool result = resumption_storage_->GetSavedApplication(
+ application->policy_app_id(), device_mac, saved_app);
+ if (result) {
+ const std::string& saved_hash = saved_app[strings::hash_id].asString();
+ result = saved_hash == hash ? RestoreApplicationData(application) : false;
+ application->UpdateHash();
+ AddToResumptionTimerQueue(application->app_id());
+ }
+ return result;
+}
+
+bool ResumeCtrlImpl::StartResumptionOnlyHMILevel(
+ ApplicationSharedPtr application) {
+ // sync_primitives::AutoLock lock(resumtion_lock_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!application) {
+ LOG4CXX_WARN(logger_, "Application does not exist.");
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "HMI level resumption requested for application id "
+ << application->app_id() << "with hmi_app_id "
+ << application->hmi_app_id() << ", policy_app_id "
+ << application->policy_app_id());
+ SetupDefaultHMILevel(application);
+ const std::string& device_mac = application->mac_address();
+ smart_objects::SmartObject saved_app;
+ bool result = resumption_storage_->GetSavedApplication(
+ application->policy_app_id(), device_mac, saved_app);
+ if (result) {
+ // sync_primitives::AutoUnlock unlock(lock);
+ AddToResumptionTimerQueue(application->app_id());
+ }
+ LOG4CXX_INFO(logger_, "StartResumptionOnlyHMILevel::Result = " << result);
+ return result;
+}
+
+void ResumeCtrlImpl::StartAppHmiStateResumption(
+ ApplicationSharedPtr application) {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+ smart_objects::SmartObject saved_app;
+ const std::string& device_mac = application->mac_address();
+ const bool result = resumption_storage_->GetSavedApplication(
+ application->policy_app_id(), device_mac, saved_app);
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Application was not saved");
+ return;
+ }
+ const uint32_t ign_off_count = saved_app[strings::ign_off_count].asUInt();
+ bool restore_data_allowed = false;
+ restore_data_allowed =
+ CheckAppRestrictions(application, saved_app) &&
+ ((0 == ign_off_count) || CheckIgnCycleRestrictions(saved_app));
+ if (restore_data_allowed) {
+ LOG4CXX_INFO(logger_,
+ "Resume application " << application->policy_app_id());
+ RestoreAppHMIState(application);
+ RemoveApplicationFromSaved(application);
+ } else {
+ LOG4CXX_INFO(logger_,
+ "Do not need to resume application "
+ << application->policy_app_id());
+ }
+}
+
+void ResumeCtrlImpl::ResetLaunchTime() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ launch_time_ = time(NULL);
+}
+
+bool ResumeCtrlImpl::CheckPersistenceFilesForResumption(
+ ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(application, false);
+ LOG4CXX_DEBUG(logger_,
+ " Resume app_id = " << application->app_id() << " policy_id = "
+ << application->policy_app_id());
+ smart_objects::SmartObject saved_app;
+ const std::string& device_mac = application->mac_address();
+ bool result = resumption_storage_->GetSavedApplication(
+ application->policy_app_id(), device_mac, saved_app);
+ if (result) {
+ if (saved_app.keyExists(strings::application_commands)) {
+ if (!CheckIcons(application, saved_app[strings::application_commands])) {
+ return false;
+ }
+ }
+ if (saved_app.keyExists(strings::application_choice_sets)) {
+ if (!CheckIcons(application,
+ saved_app[strings::application_choice_sets])) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+bool ResumeCtrlImpl::CheckApplicationHash(ApplicationSharedPtr application,
+ const std::string& hash) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(application, false);
+ LOG4CXX_DEBUG(logger_,
+ "app_id : " << application->app_id() << " hash : " << hash);
+ smart_objects::SmartObject saved_app;
+ const std::string& device_mac = application->mac_address();
+ bool result = resumption_storage_->GetSavedApplication(
+ application->policy_app_id(), device_mac, saved_app);
+ return result ? saved_app[strings::hash_id].asString() == hash : false;
+}
+
+void ResumeCtrlImpl::SaveDataOnTimer() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_resumption_active_) {
+ LOG4CXX_WARN(logger_, "Resumption timer is active skip saving");
+ return;
+ }
+
+ if (false == is_data_saved_) {
+ SaveAllApplications();
+ is_data_saved_ = true;
+ if (!application_manager_.get_settings().use_db_for_resumption()) {
+ resumption_storage_->Persist();
+ }
+ }
+}
+
+bool ResumeCtrlImpl::IsDeviceMacAddressEqual(
+ ApplicationSharedPtr application, const std::string& saved_device_mac) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string device_mac = application->mac_address();
+ return device_mac == saved_device_mac;
+}
+
+bool ResumeCtrlImpl::RestoreApplicationData(ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(application, false);
+ LOG4CXX_DEBUG(logger_, "app_id : " << application->app_id());
+
+ smart_objects::SmartObject saved_app(smart_objects::SmartType_Map);
+ const std::string& device_mac = application->mac_address();
+ bool result = resumption_storage_->GetSavedApplication(
+ application->policy_app_id(), device_mac, saved_app);
+ if (result) {
+ if (saved_app.keyExists(strings::grammar_id)) {
+ const uint32_t app_grammar_id = saved_app[strings::grammar_id].asUInt();
+ application->set_grammar_id(app_grammar_id);
+ AddFiles(application, saved_app);
+ AddSubmenues(application, saved_app);
+ AddCommands(application, saved_app);
+ AddChoicesets(application, saved_app);
+ SetGlobalProperties(application, saved_app);
+ AddSubscriptions(application, saved_app);
+ AddWayPointsSubscription(application, saved_app);
+ result = true;
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Saved data of application does not contain grammar_id");
+ result = false;
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Application not saved");
+ }
+ return result;
+}
+
+void ResumeCtrlImpl::AddFiles(ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (saved_app.keyExists(strings::application_files)) {
+ const smart_objects::SmartObject& application_files =
+ saved_app[strings::application_files];
+ for (size_t i = 0; i < application_files.length(); ++i) {
+ const smart_objects::SmartObject& file_data = application_files[i];
+ const bool is_persistent =
+ file_data.keyExists(strings::persistent_file) &&
+ file_data[strings::persistent_file].asBool();
+ if (is_persistent) {
+ AppFile file;
+ file.is_persistent = is_persistent;
+ file.is_download_complete =
+ file_data[strings::is_download_complete].asBool();
+ file.file_name = file_data[strings::sync_file_name].asString();
+ file.file_type = static_cast<mobile_apis::FileType::eType>(
+ file_data[strings::file_type].asInt());
+ application->AddFile(file);
+ }
+ }
+ } else {
+ LOG4CXX_FATAL(logger_, "application_files section is not exists");
+ }
+}
+
+void ResumeCtrlImpl::AddSubmenues(ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (saved_app.keyExists(strings::application_submenus)) {
+ const smart_objects::SmartObject& app_submenus =
+ saved_app[strings::application_submenus];
+ for (size_t i = 0; i < app_submenus.length(); ++i) {
+ const smart_objects::SmartObject& submenu = app_submenus[i];
+ application->AddSubMenu(submenu[strings::menu_id].asUInt(), submenu);
+ }
+ ProcessHMIRequests(MessageHelper::CreateAddSubMenuRequestToHMI(
+ application, application_manager_.GetNextHMICorrelationID()));
+ } else {
+ LOG4CXX_FATAL(logger_, "application_submenus section is not exists");
+ }
+}
+
+void ResumeCtrlImpl::AddCommands(ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (saved_app.keyExists(strings::application_commands)) {
+ const smart_objects::SmartObject& app_commands =
+ saved_app[strings::application_commands];
+ for (size_t i = 0; i < app_commands.length(); ++i) {
+ const smart_objects::SmartObject& command = app_commands[i];
+
+ application->AddCommand(command[strings::cmd_id].asUInt(), command);
+ }
+ ProcessHMIRequests(MessageHelper::CreateAddCommandRequestToHMI(
+ application, application_manager_));
+ } else {
+ LOG4CXX_FATAL(logger_, "application_commands section is not exists");
+ }
+}
+
+void ResumeCtrlImpl::AddChoicesets(
+ ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (saved_app.keyExists(strings::application_choice_sets)) {
+ const smart_objects::SmartObject& app_choice_sets =
+ saved_app[strings::application_choice_sets];
+ for (size_t i = 0; i < app_choice_sets.length(); ++i) {
+ const smart_objects::SmartObject& choice_set = app_choice_sets[i];
+ const int32_t choice_set_id =
+ choice_set[strings::interaction_choice_set_id].asInt();
+ application->AddChoiceSet(choice_set_id, choice_set);
+ }
+ ProcessHMIRequests(MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(
+ application, application_manager_));
+ } else {
+ LOG4CXX_FATAL(logger_, "There is no any choicesets");
+ }
+}
+
+void ResumeCtrlImpl::SetGlobalProperties(
+ ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (saved_app.keyExists(strings::application_global_properties)) {
+ const smart_objects::SmartObject& properties_so =
+ saved_app[strings::application_global_properties];
+ application->load_global_properties(properties_so);
+ MessageHelper::SendGlobalPropertiesToHMI(application, application_manager_);
+ }
+}
+
+void ResumeCtrlImpl::AddWayPointsSubscription(
+ app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (saved_app.keyExists(strings::subscribed_for_way_points)) {
+ 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());
+ }
+ }
+}
+
+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 (subscribtions.keyExists(strings::application_buttons)) {
+ const smart_objects::SmartObject& subscribtions_buttons =
+ subscribtions[strings::application_buttons];
+ mobile_apis::ButtonName::eType btn;
+ for (size_t i = 0; i < subscribtions_buttons.length(); ++i) {
+ btn = static_cast<mobile_apis::ButtonName::eType>(
+ (subscribtions_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());
+ application->SubscribeToIVI(ivi);
+ }
+ ProcessHMIRequests(MessageHelper::GetIVISubscriptionRequests(
+ application, application_manager_));
+ }
+ }
+}
+
+bool ResumeCtrlImpl::CheckIgnCycleRestrictions(
+ const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool result = true;
+
+ if (!CheckDelayAfterIgnOn()) {
+ LOG4CXX_INFO(logger_, "Application was connected long after ign on");
+ result = false;
+ }
+
+ if (!DisconnectedJustBeforeIgnOff(saved_app)) {
+ LOG4CXX_INFO(logger_, "Application was dissconnected long before ign off");
+ result = false;
+ }
+ return result;
+}
+
+bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff(
+ const smart_objects::SmartObject& saved_app) {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
+
+ const time_t time_stamp =
+ static_cast<time_t>(saved_app[strings::time_stamp].asUInt());
+ 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);
+ LOG4CXX_DEBUG(
+ logger_,
+ "ign_off_time "
+ << ign_off_time << "; app_disconnect_time " << time_stamp
+ << "; sec_spent_before_ign " << sec_spent_before_ign
+ << "; resumption_delay_before_ign "
+ << application_manager_.get_settings().resumption_delay_before_ign());
+ return sec_spent_before_ign <=
+ application_manager_.get_settings().resumption_delay_before_ign();
+}
+
+bool ResumeCtrlImpl::CheckAppRestrictions(
+ ApplicationConstSharedPtr application,
+ const smart_objects::SmartObject& saved_app) {
+ using namespace mobile_apis;
+ using namespace helpers;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(saved_app.keyExists(strings::hmi_level), false);
+
+ const HMILevel::eType hmi_level =
+ static_cast<HMILevel::eType>(saved_app[strings::hmi_level].asInt());
+ const bool result = Compare<HMILevel::eType, EQ, ONE>(
+ hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)
+ ? true
+ : false;
+ LOG4CXX_DEBUG(logger_,
+ "is_media_app " << application->is_media_application()
+ << "; hmi_level " << hmi_level << " result "
+ << result);
+ return result;
+}
+
+bool ResumeCtrlImpl::CheckIcons(ApplicationSharedPtr application,
+ smart_objects::SmartObject& obj) {
+ using namespace smart_objects;
+ LOG4CXX_AUTO_TRACE(logger_);
+ const mobile_apis::Result::eType verify_images =
+ MessageHelper::VerifyImageFiles(obj, application, application_manager_);
+ return mobile_apis::Result::INVALID_DATA != verify_images;
+}
+
+bool ResumeCtrlImpl::CheckDelayAfterIgnOn() {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+ const time_t curr_time = time(NULL);
+ const time_t sdl_launch_time = LaunchTime();
+ const uint32_t seconds_from_sdl_start = labs(curr_time - sdl_launch_time);
+ const uint32_t wait_time =
+ application_manager_.get_settings().resumption_delay_after_ign();
+ LOG4CXX_DEBUG(logger_,
+ "curr_time " << curr_time << "; sdl_launch_time "
+ << sdl_launch_time << "; seconds_from_sdl_start "
+ << seconds_from_sdl_start << "; wait_time "
+ << wait_time);
+ return seconds_from_sdl_start <= wait_time;
+}
+
+time_t ResumeCtrlImpl::LaunchTime() const {
+ return launch_time_;
+}
+
+time_t ResumeCtrlImpl::GetIgnOffTime() {
+ return resumption_storage_->GetIgnOffTime();
+}
+
+bool ResumeCtrlImpl::ProcessHMIRequest(smart_objects::SmartObjectSPtr request,
+ bool use_events) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (use_events) {
+ const hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*request)[strings::function_id].asInt());
+
+ const int32_t hmi_correlation_id =
+ (*request)[strings::correlation_id].asInt();
+ subscribe_on_event(function_id, hmi_correlation_id);
+ }
+ if (!application_manager_.ManageHMICommand(request)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ return false;
+ }
+ return true;
+}
+
+void ResumeCtrlImpl::ProcessHMIRequests(
+ const smart_objects::SmartObjectList& requests) {
+ for (smart_objects::SmartObjectList::const_iterator it = requests.begin(),
+ total = requests.end();
+ it != total;
+ ++it) {
+ ProcessHMIRequest(*it, true);
+ }
+}
+
+void ResumeCtrlImpl::AddToResumptionTimerQueue(const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ queue_lock_.Acquire();
+ waiting_for_timer_.push_back(app_id);
+ queue_lock_.Release();
+ LOG4CXX_DEBUG(logger_,
+ "Application ID " << app_id << " have been added"
+ " to resumption queue.");
+ if (!is_resumption_active_) {
+ is_resumption_active_ = true;
+ restore_hmi_level_timer_.Start(
+ application_manager_.get_settings().app_resuming_timeout(),
+ timer::kSingleShot);
+ }
+}
+
+void ResumeCtrlImpl::LoadResumeData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject so_applications_data;
+ resumption_storage_->GetDataForLoadResumeData(so_applications_data);
+ size_t length = so_applications_data.length();
+ for (size_t i = 0; i < length; ++i) {
+ smart_objects::SmartObject& application = so_applications_data[i];
+ if (IsAppDataResumptionExpired(application)) {
+ const std::string device_id = application[strings::device_id].asString();
+ const std::string app_id = application[strings::app_id].asString();
+ LOG4CXX_INFO(logger_, "Data resumption is expired.");
+ LOG4CXX_DEBUG(logger_,
+ "Resumption data for application "
+ << app_id << " and device id " << device_id
+ << " will be dropped.");
+ resumption_storage_->DropAppDataResumption(device_id, app_id);
+ continue;
+ }
+ }
+}
+
+void ResumeCtrlImpl::OnAppRegistrationStart(const std::string& policy_app_id,
+ const std::string& device_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (IsApplicationSaved(policy_app_id, device_id)) {
+ LOG4CXX_INFO(
+ logger_,
+ "Application is found in resumption "
+ "data and will try to resume. Stopping resume data persistent timer");
+ StopSavePersistentDataTimer();
+ }
+}
+
+void ResumeCtrlImpl::OnAppRegistrationEnd() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ StartSavePersistentDataTimer();
+}
+
+int32_t ResumeCtrlImpl::GetSavedAppHmiLevel(
+ const std::string& app_id, const std::string& device_id) const {
+ 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();
+ return saved_hmi_level;
+ }
+ return static_cast<int32_t>(mobile_apis::HMILevel::INVALID_ENUM);
+}
+
+bool ResumeCtrlImpl::IsAppDataResumptionExpired(
+ const smart_objects::SmartObject& application) const {
+ const int32_t max_ign_off_count = 3;
+ return max_ign_off_count <= application[strings::ign_off_count].asInt();
+}
+
+} // namespce resumption
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..7866fc4de1 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
@@ -372,10 +372,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];
@@ -481,7 +480,7 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id,
}
void ResumptionDataJson::Persist() {
- last_state().SaveToFileSystem();
+ last_state().SaveStateToFileSystem();
}
} // resumption
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 8b8c17fc5a..99d9e4122a 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -18,6 +18,12 @@ const char* msg_params = "msg_params";
const char* method_name = "methodName";
const char* info = "info";
const char* app_id = "appID";
+const char* bundle_id = "appBundleID";
+const char* app_info = "appInfo";
+const char* app_launch = "app_launch";
+const char* app_launch_list = "app_launch_list";
+const char* app_launch_last_session = "app_launch_last_session";
+const char* policy_app_id = "policyAppID";
const char* hmi_app_id = "hmiAppID";
const char* device_id = "deviceID";
const char* subscribed_for_way_points = "subscribed_for_way_points";
@@ -30,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";
@@ -125,6 +132,9 @@ 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";
+
// PutFile
const char* sync_file_name = "syncFileName";
const char* file_name = "fileName";
@@ -267,6 +277,22 @@ 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";
} // namespace strings
namespace json {
@@ -340,6 +366,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
@@ -401,5 +428,3 @@ const char* event_name = "eventName";
} // namespace hmi_notification
} // namespace application_manager
-
-#
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 839cc13026..06a7e508e5 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,
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 118cda4fcb..dba8d99a62 100644
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/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,47 +28,58 @@
# 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)
+
# 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
+# TODO{ILytvynenko}: SDLOPEN-797 Uncomment application_manager_impl_test and
+# cover with UT missed files.
+
+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/
+ ${POLICY_PATH}/policy/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+ ${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}/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}/mock_message_helper.cc
+ #${AM_TEST_DIR}/application_manager_impl_test.cc
+
+)
+
+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
@@ -88,85 +99,49 @@ set(testLibraries
SecurityManager
)
-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("request_controller_test" "${RequestController_SOURCES}" "${LIBRARIES}")
+
+# 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("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/CMakeLists.txt b/src/components/application_manager/test/app_launch/CMakeLists.txt
new file mode 100644
index 0000000000..1c038020b9
--- /dev/null
+++ b/src/components/application_manager/test/app_launch/CMakeLists.txt
@@ -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.
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/include/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/include/test
+ ${COMPONENTS_DIR}/include/
+)
+
+set(LIBRARIES
+ gmock
+ Resumption
+ jsoncpp
+ SmartObjects
+ ApplicationManager
+)
+
+ 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(APP_LAUNCH_DATA_TEST_SOURCES
+ app_launch_data_db_test.cc
+ app_launch_data_json_test.cc
+)
+
+create_test("app_launch_ctrl_test" app_launch_ctrl_test.cc "${LIBRARIES}")
+create_test("app_launch_data_test" "${APP_LAUNCH_DATA_TEST_SOURCES}" "${LIBRARIES}")
diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
new file mode 100644
index 0000000000..1b90f29647
--- /dev/null
+++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
@@ -0,0 +1,371 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <sstream>
+#include "utils/macro.h"
+#include "application_manager/app_launch/app_launch_ctrl_impl.h"
+#include "application_manager/mock_app_launch_data.h"
+#include "application_manager/mock_app_launch_settings.h"
+#include "application_manager/mock_resume_ctrl.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "utils/make_shared.h"
+#include "utils/test_async_waiter.h"
+
+namespace test {
+namespace components {
+namespace app_launch_test {
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Truly;
+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;
+
+const uint32_t MAX_TEST_DURATION = 1000; // 1 second
+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> >();
+
+ ON_CALL(*app, mac_address()).WillByDefault(ReturnRef(app_data.device_mac_));
+ ON_CALL(*app, bundle_id()).WillByDefault(ReturnRef(app_data.bundle_id_));
+ ON_CALL(*app, policy_app_id())
+ .WillByDefault(Return(app_data.mobile_app_id_));
+ return app;
+ }
+
+ app_launch::ApplicationDataPtr AppDataFromApp(
+ const am_test::MockApplication& app) {
+ app_launch::ApplicationDataPtr app_data =
+ utils::MakeShared<NiceMock<app_launch::ApplicationData> >(
+ app.policy_app_id(), app.bundle_id(), app.mac_address());
+ return app_data;
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(settings_, app_launch_wait_time()).WillByDefault(Return(5));
+ ON_CALL(settings_, app_launch_max_retry_attempt()).WillByDefault(Return(3));
+ ON_CALL(settings_, app_launch_retry_wait_time()).WillByDefault(Return(15));
+ ON_CALL(settings_, remove_bundle_id_attempts()).WillByDefault(Return(3));
+ ON_CALL(settings_, max_number_of_ios_device()).WillByDefault(Return(10));
+ ON_CALL(settings_, wait_time_between_apps()).WillByDefault(Return(4));
+ ON_CALL(settings_, enable_app_launch_ios()).WillByDefault(Return(true));
+ ON_CALL(settings_, resumption_delay_after_ign()).WillByDefault(Return(30));
+ ON_CALL(resume_ctrl_mock_, LaunchTime()).WillByDefault(Return(0));
+
+ ON_CALL(app_mngr_mock_, resume_controller())
+ .WillByDefault(ReturnRef(resume_ctrl_mock_));
+ ON_CALL(app_mngr_mock_, connection_handler())
+ .WillByDefault(ReturnRef(connection_handler_mock_));
+ app_launch_ctrl_.reset(new app_launch::AppLaunchCtrlImpl(
+ app_launch_data_mock_, app_mngr_mock_, settings_));
+ FillApplications();
+ }
+
+ typedef std::pair<MockAppPtr, app_launch::ApplicationDataPtr> AppAndAppData;
+ std::vector<AppAndAppData> test_app_datas_;
+
+ app_launch::ApplicationDataPtr GetTestAppData(size_t index) {
+ return test_app_datas_[index].second;
+ }
+
+ MockAppPtr GetTestApp(size_t index) {
+ return test_app_datas_[index].first;
+ }
+
+ const std::string DeviceMac(size_t device_number) {
+ std::ostringstream ss;
+ ss << "device_mac_" << device_number;
+ return ss.str();
+ }
+
+ std::vector<AppAndAppData> DeviceApps(std::string device_mac) {
+ std::vector<AppAndAppData> res;
+ std::vector<AppAndAppData>::iterator it = test_app_datas_.begin();
+ for (; it != test_app_datas_.end(); ++it) {
+ const AppAndAppData& app_and_data = *it;
+ if (app_and_data.second->device_mac_ == device_mac) {
+ res.push_back(app_and_data);
+ }
+ }
+ return res;
+ }
+
+ AppAndAppData GetAppAndAppData(const std::string& app_id,
+ const std::string& bundle_id,
+ const std::string& device_mac) {
+ using app_launch::ApplicationData;
+ AppAndAppData app;
+ app.second =
+ utils::MakeShared<ApplicationData>(app_id, bundle_id, device_mac);
+ app.first = AppFromAppData(*app.second);
+ return app;
+ }
+
+ void FillApplications() {
+ test_app_datas_.push_back(
+ GetAppAndAppData("mob_id1", "bundle_id1", DeviceMac(1)));
+ test_app_datas_.push_back(
+ GetAppAndAppData("mob_id2", "bundle_id2", DeviceMac(1)));
+ test_app_datas_.push_back(
+ GetAppAndAppData("mob_id3", "bundle_id3", DeviceMac(1)));
+ test_app_datas_.push_back(
+ GetAppAndAppData("mob_id4", "bundle_id4", DeviceMac(2)));
+ test_app_datas_.push_back(
+ GetAppAndAppData("mob_id5", "bundle_id5", DeviceMac(2)));
+ test_app_datas_.push_back(
+ GetAppAndAppData("mob_id6", "bundle_id6", DeviceMac(3)));
+ }
+
+ void ExpectRegisteration(const AppAndAppData& app_data);
+
+ NiceMock<am_test::MockApplicationManager> app_mngr_mock_;
+ NiceMock<app_launch_test::AppLaunchDataMock> app_launch_data_mock_;
+ NiceMock<ch_test::MockConnectionHandler> connection_handler_mock_;
+ NiceMock<resumprion_test::MockResumeCtrl> resume_ctrl_mock_;
+ NiceMock<app_launch_test::MockAppLaunchSettings> settings_;
+ std::auto_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
+};
+
+app_launch::ApplicationData AppDataFromApp(
+ application_manager::Application& app) {
+ // TODO(AK) Use amc op device
+ return app_launch::ApplicationData(
+ app.policy_app_id(), app.bundle_id(), "Dummy Deevice Id");
+}
+
+struct AppDataComparator {
+ const app_launch::ApplicationData& app_data_;
+
+ AppDataComparator(const app_launch::ApplicationData& app_data)
+ : app_data_(app_data) {}
+
+ bool operator()(const app_launch::ApplicationData& app_data) const {
+ return app_data_ == app_data;
+ }
+};
+
+TEST_F(AppLaunchCtrlTest, AddRegisteredApplicationToDataStorage) {
+ MockAppPtr app = GetTestApp(0);
+ EXPECT_CALL(app_launch_data_mock_,
+ AddApplicationData(Truly(AppDataComparator(*GetTestAppData(0)))));
+ app_launch_ctrl_->OnAppRegistered(*app);
+}
+
+ACTION_P2(InvokeOnAppRegistered, app_launch_ctrl, app) {
+ (app_launch_ctrl->*&app_launch::AppLaunchCtrlImpl::OnAppRegistered)(*app);
+}
+
+TEST_F(AppLaunchCtrlTest, StoredAppIsLaunchedAfterDeviceConnected) {
+ std::vector<app_launch::ApplicationDataPtr> applications_on_device;
+ 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_))
+ .WillOnce(Return(applications_on_device));
+ EXPECT_CALL(
+ connection_handler_mock_,
+ RunAppOnDevice(app_to_launch->device_mac_, app_to_launch->bundle_id_))
+ .Times(AtLeast(1))
+ .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();
+ 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));
+
+ EXPECT_CALL(
+ connection_handler_mock_,
+ RunAppOnDevice(app_to_launch->device_mac_, app_to_launch->bundle_id_))
+ .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();
+ EXPECT_TRUE(waiter.WaitFor(times, wait_time));
+}
+
+TEST_F(AppLaunchCtrlTest, LaunchMultipleApps) {
+ std::vector<AppAndAppData> apps_and_data = DeviceApps(DeviceMac(1));
+ std::vector<app_launch::ApplicationDataPtr> apps;
+ for (std::vector<AppAndAppData>::iterator it = apps_and_data.begin();
+ it != apps_and_data.end();
+ ++it) {
+ 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));
+
+ // 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))
+ .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();
+ waiter.WaitFor(times, wait_time);
+}
+
+TEST_F(AppLaunchCtrlTest, LaunchMultipleAppsNoRegister) {
+ std::vector<AppAndAppData> apps_and_data = DeviceApps(DeviceMac(1));
+ std::vector<app_launch::ApplicationDataPtr> apps;
+ for (std::vector<AppAndAppData>::iterator it = apps_and_data.begin();
+ it != apps_and_data.end();
+ ++it) {
+ 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));
+
+ // Expect multiple call
+ for (std::vector<AppAndAppData>::iterator it = apps_and_data.begin();
+ it != apps_and_data.end();
+ ++it) {
+ const AppAndAppData& app_data = *it;
+ EXPECT_CALL(connection_handler_mock_,
+ RunAppOnDevice(app_data.second->device_mac_,
+ app_data.second->bundle_id_))
+ .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();
+ waiter.WaitFor(times, wait_time);
+}
+
+TEST_F(AppLaunchCtrlTest, LaunchMultipleAppsInHMILevelOrder) {
+ std::vector<AppAndAppData> apps_and_data = DeviceApps(DeviceMac(1));
+ DCHECK(apps_and_data.size() == 3);
+ std::vector<app_launch::ApplicationDataPtr> apps;
+
+ {
+ app_launch::ApplicationDataPtr app_data = apps_and_data[0].second;
+ EXPECT_CALL(
+ resume_ctrl_mock_,
+ GetSavedAppHmiLevel(app_data->mobile_app_id_, app_data->device_mac_))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ apps.push_back(app_data);
+ }
+
+ {
+ app_launch::ApplicationDataPtr app_data = apps_and_data[1].second;
+ EXPECT_CALL(
+ resume_ctrl_mock_,
+ GetSavedAppHmiLevel(app_data->mobile_app_id_, app_data->device_mac_))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_LIMITED));
+ ;
+ apps.push_back(app_data);
+ }
+
+ {
+ app_launch::ApplicationDataPtr app_data = apps_and_data[2].second;
+ EXPECT_CALL(
+ resume_ctrl_mock_,
+ GetSavedAppHmiLevel(app_data->mobile_app_id_, app_data->device_mac_))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+ ;
+ 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));
+ // 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();
+ waiter.WaitFor(times, wait_time);
+}
+
+} // namespace app_launch_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
new file mode 100644
index 0000000000..e095f0682e
--- /dev/null
+++ b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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>
+#include <memory>
+#include "gtest/gtest.h"
+#include "utils/macro.h"
+#include "sql_database.h"
+#include "sql_query.h"
+#include "utils/make_shared.h"
+#include "utils/file_system.h"
+#include "application_manager/mock_app_launch_settings.h"
+#include "application_manager/app_launch/app_launch_data_db.h"
+#include "application_manager/app_launch/app_launch_sql_queries.h"
+
+namespace test {
+namespace components {
+namespace app_launch_test {
+
+using namespace file_system;
+using namespace app_launch;
+
+using ::testing::ReturnRef;
+using ::testing::Return;
+using ::testing::NiceMock;
+
+namespace {
+const std::string kEmptyString = "";
+const std::string kMobileAppId = "mobile_app_id";
+const std::string kBundleId = "bundle_id";
+const std::string kDeviceMac = "device_mac";
+} // namespace
+
+class AppLaunchDataDBTest : public ::testing::Test {
+ protected:
+ virtual void SetUp() {
+ utils::dbms::SQLQuery query(test_db());
+ EXPECT_TRUE(query.Prepare(kCreateSchema));
+ EXPECT_TRUE(query.Exec());
+ printf("Create table\n");
+ }
+
+ virtual void TearDown() {
+ utils::dbms::SQLQuery query(test_db());
+ EXPECT_TRUE(query.Prepare(kDropSchema));
+ EXPECT_TRUE(query.Exec());
+ printf("Delete table\n");
+ }
+
+ static void SetUpTestCase() {
+ NiceMock<MockAppLaunchSettings> mock_app_launch_settings_;
+ std::string curr_dir = file_system::CurrentWorkingDirectory();
+ ON_CALL(mock_app_launch_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(curr_dir));
+ ON_CALL(mock_app_launch_settings_, max_number_of_ios_device())
+ .WillByDefault(Return(15u));
+ ON_CALL(mock_app_launch_settings_, app_launch_max_retry_attempt())
+ .WillByDefault(Return(5u));
+ ON_CALL(mock_app_launch_settings_, app_launch_retry_wait_time())
+ .WillByDefault(Return(500u));
+ if (is_in_file) {
+ res_db_.reset(
+ new AppLaunchDataDB(mock_app_launch_settings_, In_File_Storage));
+ } else {
+ res_db_.reset(
+ new AppLaunchDataDB(mock_app_launch_settings_, In_Memory_Storage));
+ }
+ test_db_ = (res_db_->db());
+
+ EXPECT_TRUE(test_db()->Open());
+ EXPECT_TRUE(test_db()->IsReadWrite());
+ }
+
+ // Memory keep and clear AppLaunchDataDb
+ static utils::dbms::SQLDatabase* test_db_;
+
+ static void TearDownTestCase() {
+ DeleteFile(kDatabaseName + ".sqlite");
+ }
+
+ static utils::dbms::SQLDatabase* test_db() {
+ return test_db_;
+ }
+
+ static std::auto_ptr<AppLaunchDataDB> res_db_;
+
+ AppLaunchDataDB* res_db() {
+ return res_db_.get();
+ }
+
+ const std::string kGetSsession =
+ " SELECT * FROM `app_launch` WHERE `deviceMac` = ? AND `appID` = ? AND "
+ "`bundleID` = ?;";
+ const std::string kCheckTablesExist =
+ "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND "
+ "name='app_launch';";
+
+ const std::string kInsertTimestamp =
+ "UPDATE 'app_launch' "
+ "SET 'last_session' = ' 1666-06-16 06:06:06.666 '"
+ "WHERE `deviceMac` = ? AND `appID` = ? "
+ "AND `bundleID` = ?;";
+
+ // Write BD to file or memory
+ static const bool is_in_file = false;
+
+ public:
+ void AddApplicationDataWithIncreaseTable(const ApplicationData& data);
+ void AddApplicationDataWithoutIncreaseTable(const ApplicationData& data);
+ std::string GetApplicationData(const ApplicationData& in_data,
+ ApplicationData& out_data);
+ std::string AddCounter(const std::string& inp, int32_t val);
+ void AddApplicationData_Expect_FALSE(const ApplicationData& data);
+};
+
+utils::dbms::SQLDatabase* AppLaunchDataDBTest::test_db_ = NULL;
+std::auto_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
+
+void AppLaunchDataDBTest::AddApplicationDataWithIncreaseTable(
+ const ApplicationData& data) {
+ uint32_t sizeBeforeAdding = res_db()->GetCurentNumberOfAppData();
+ EXPECT_TRUE(res_db()->AddApplicationData(data));
+
+ uint32_t sizeAfterAdding = res_db()->GetCurentNumberOfAppData();
+ EXPECT_EQ(sizeBeforeAdding + 1u, sizeAfterAdding);
+}
+
+void AppLaunchDataDBTest::AddApplicationDataWithoutIncreaseTable(
+ const ApplicationData& data) {
+ uint32_t sizeBeforeAdding = res_db()->GetCurentNumberOfAppData();
+ EXPECT_TRUE(res_db()->AddApplicationData(data));
+
+ uint32_t sizeAfterAdding = res_db()->GetCurentNumberOfAppData();
+ EXPECT_EQ(sizeBeforeAdding, sizeAfterAdding);
+}
+
+std::string AppLaunchDataDBTest::GetApplicationData(
+ const ApplicationData& in_data, ApplicationData& out_data) {
+ utils::dbms::SQLQuery query(test_db());
+ uint32_t sizeBeforeAdding = res_db()->GetCurentNumberOfAppData();
+ EXPECT_TRUE(query.Prepare(kGetSsession));
+ query.Bind(AppLaunchDataDB::device_mac_index, in_data.device_mac_);
+ query.Bind(AppLaunchDataDB::application_id_index, in_data.mobile_app_id_);
+ query.Bind(AppLaunchDataDB::bundle_id_index, in_data.bundle_id_);
+ EXPECT_TRUE(query.Exec());
+
+ uint32_t sizeAfterAdding = res_db()->GetCurentNumberOfAppData();
+
+ EXPECT_EQ(sizeBeforeAdding, sizeAfterAdding);
+
+ out_data.device_mac_ = query.GetString(AppLaunchDataDB::device_mac_index);
+ out_data.mobile_app_id_ =
+ query.GetString(AppLaunchDataDB::application_id_index);
+ out_data.bundle_id_ = query.GetString(AppLaunchDataDB::bundle_id_index);
+ // Timestamp
+ return query.GetString(AppLaunchDataDB::timestamp_index);
+}
+
+std::string AppLaunchDataDBTest::AddCounter(const std::string& inp,
+ int32_t val) {
+ std::stringstream ss;
+ ss << inp << "_" << val;
+ return ss.str();
+}
+
+TEST_F(AppLaunchDataDBTest, Init) {
+ utils::dbms::SQLQuery query_checks(test_db());
+ EXPECT_TRUE(query_checks.Prepare(kCheckTablesExist));
+ EXPECT_TRUE(query_checks.Exec());
+ EXPECT_EQ(1u, query_checks.GetUInteger(0));
+}
+
+TEST_F(AppLaunchDataDBTest, SaveAndGetData) {
+ ApplicationData data(kMobileAppId, kBundleId, kDeviceMac);
+ AddApplicationDataWithIncreaseTable(data);
+ ApplicationData recoveredData(kEmptyString, kEmptyString, kEmptyString);
+ GetApplicationData(data, recoveredData);
+ EXPECT_TRUE(data == recoveredData);
+}
+
+TEST_F(AppLaunchDataDBTest, NotAddEmptyAppData) {
+ ApplicationData data1(kEmptyString, kBundleId, kDeviceMac);
+ ApplicationData data2(kMobileAppId, kEmptyString, kDeviceMac);
+ ApplicationData data3(kMobileAppId, kBundleId, kEmptyString);
+ ApplicationData data4(kEmptyString, kEmptyString, kEmptyString);
+ EXPECT_FALSE(res_db()->AddApplicationData(data1));
+ EXPECT_FALSE(res_db()->AddApplicationData(data2));
+ EXPECT_FALSE(res_db()->AddApplicationData(data3));
+ EXPECT_FALSE(res_db()->AddApplicationData(data4));
+ EXPECT_EQ(0u, res_db()->GetCurentNumberOfAppData());
+}
+
+TEST_F(AppLaunchDataDBTest, SaveOneAndGetAnotherData) {
+ ApplicationData data(kMobileAppId, kBundleId, kDeviceMac);
+ ApplicationData recoverData = data;
+ AddApplicationDataWithIncreaseTable(data);
+ recoverData.device_mac_ += "test";
+ GetApplicationData(recoverData, recoverData);
+ EXPECT_FALSE(data == recoverData);
+}
+
+TEST_F(AppLaunchDataDBTest, MaxCount) {
+ const uint32_t max_ios_devs = res_db()->get_max_number_iOS_devs();
+
+ for (uint32_t i = 0; i < max_ios_devs; i++) {
+ ApplicationData data(
+ AddCounter(kMobileAppId, i), AddCounter(kBundleId, i), kDeviceMac);
+ AddApplicationDataWithIncreaseTable(data);
+ }
+
+ utils::dbms::SQLQuery query(test_db());
+ ApplicationData changedRecord(
+ AddCounter(kMobileAppId, 0), AddCounter(kBundleId, 0), kDeviceMac);
+ EXPECT_TRUE(query.Prepare(kInsertTimestamp));
+ query.Bind(AppLaunchDataDB::device_mac_index, changedRecord.device_mac_);
+ query.Bind(AppLaunchDataDB::application_id_index,
+ changedRecord.mobile_app_id_);
+ query.Bind(AppLaunchDataDB::bundle_id_index, changedRecord.bundle_id_);
+ EXPECT_TRUE(query.Exec());
+
+ uint32_t size_max = res_db()->GetCurentNumberOfAppData();
+ EXPECT_EQ(max_ios_devs, size_max);
+ EXPECT_TRUE(res_db()->AddApplicationData(
+ ApplicationData(AddCounter(kMobileAppId, max_ios_devs),
+ AddCounter(kBundleId, max_ios_devs),
+ kDeviceMac)));
+ uint32_t size_after_max = res_db()->GetCurentNumberOfAppData();
+ EXPECT_EQ(size_max, size_after_max);
+ EXPECT_FALSE(res_db()->IsAppDataAlreadyExisted(changedRecord));
+}
+
+namespace {
+bool ApplicationDataComporator(const ApplicationDataPtr& left,
+ const ApplicationDataPtr& right) {
+ return (left->device_mac_ < right->device_mac_ &&
+ left->mobile_app_id_ < right->mobile_app_id_ &&
+ left->bundle_id_ < right->bundle_id_);
+}
+} // namespace
+
+TEST_F(AppLaunchDataDBTest, SelectMultipleData) {
+ std::vector<ApplicationDataPtr> input_data1;
+ std::vector<ApplicationDataPtr> input_data2;
+ std::vector<ApplicationDataPtr> output_data1;
+ std::vector<ApplicationDataPtr> output_data2;
+ const std::string device_mac_1 = "device_mac_1";
+ const std::string device_mac_2 = "device_mac_2";
+
+ uint32_t half_of_max_number_iOS_devs =
+ res_db()->get_max_number_iOS_devs() / 2u;
+
+ for (uint32_t i = 0; i < half_of_max_number_iOS_devs; i++) {
+ const std::string mobile_app_id = AddCounter("d1_mobile_app_id", i);
+ const std::string bundle_id = AddCounter("d1_bundle_id", i);
+
+ ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ mobile_app_id, bundle_id, device_mac_1);
+ AddApplicationDataWithIncreaseTable(*app_data);
+ input_data1.push_back(app_data);
+ }
+
+ for (uint32_t i = 0; i < half_of_max_number_iOS_devs; i++) {
+ const std::string mobile_app_id = AddCounter("d2_mobile_app_id", i);
+ const std::string bundle_id = AddCounter("d2_bundle_id", i);
+
+ ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ mobile_app_id, bundle_id, device_mac_2);
+ AddApplicationDataWithIncreaseTable(*app_data);
+ input_data2.push_back(app_data);
+ }
+
+ output_data1 = res_db()->GetApplicationDataByDevice(device_mac_1);
+ output_data2 = res_db()->GetApplicationDataByDevice(device_mac_2);
+
+ EXPECT_EQ(half_of_max_number_iOS_devs, output_data1.size());
+ EXPECT_EQ(half_of_max_number_iOS_devs, output_data2.size());
+
+ std::sort(
+ output_data1.begin(), output_data1.end(), ApplicationDataComporator);
+ std::sort(
+ output_data2.begin(), output_data2.end(), ApplicationDataComporator);
+ std::sort(input_data1.begin(), input_data1.end(), ApplicationDataComporator);
+ std::sort(input_data2.begin(), input_data2.end(), ApplicationDataComporator);
+
+ for (uint32_t i = 0; i < output_data1.size(); i++) {
+ EXPECT_TRUE(*output_data1[i] == *input_data1[i]);
+ }
+
+ for (uint32_t i = 0; i < output_data2.size(); i++) {
+ EXPECT_TRUE(*output_data2[i] == *input_data2[i]);
+ }
+}
+
+// Most be last cause after it AppLaunchDataDBTest
+// requeste manual Init call
+TEST_F(AppLaunchDataDBTest, DeleteAllTableDataTwice) {
+ for (uint32_t i = 0; i < res_db()->get_max_number_iOS_devs(); i++) {
+ ApplicationData data(
+ AddCounter(kMobileAppId, i), AddCounter(kBundleId, i), kDeviceMac);
+ AddApplicationDataWithIncreaseTable(data);
+ }
+
+ uint32_t full_size = res_db()->GetCurentNumberOfAppData();
+
+ EXPECT_EQ(full_size, res_db()->get_max_number_iOS_devs());
+ EXPECT_TRUE(res_db()->Clear()); // delete data
+ EXPECT_EQ(0u, res_db()->GetCurentNumberOfAppData());
+ EXPECT_TRUE(res_db()->Clear()); // second time delete data
+ EXPECT_EQ(0u, res_db()->GetCurentNumberOfAppData());
+}
+
+} // namespace app_launch_test
+} // namespace components
+} // namespace 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
new file mode 100644
index 0000000000..cc7d3f5814
--- /dev/null
+++ b/src/components/application_manager/test/app_launch/app_launch_data_json_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 <algorithm>
+#include <sstream>
+#include <memory>
+#include "json/json.h"
+#include "gtest/gtest.h"
+#include "utils/macro.h"
+#include "utils/make_shared.h"
+#include "utils/file_system.h"
+#include "utils/date_time.h"
+#include "resumption/last_state_impl.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_app_launch_settings.h"
+#include "application_manager/app_launch/app_launch_data_json.h"
+
+namespace test {
+namespace components {
+namespace test_app_launch {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+
+namespace am = application_manager;
+using namespace Json;
+using namespace file_system;
+
+using namespace app_launch;
+
+const std::string kAppStorageFolder = "app_storage_folder";
+const std::string kAppStorageFile = "./app_info.dat";
+const std::string kAppInfoStorage = "app_info_storage";
+
+class AppLaunchDataJsonTest : public ::testing::Test {
+ private:
+ virtual void SetUp() {
+ ::file_system::DeleteFile(kAppStorageFile);
+ test_last_state_ = std::auto_ptr<resumption::LastState>(
+ new resumption::LastStateImpl(kAppStorageFolder, kAppInfoStorage));
+ ASSERT_TRUE(::file_system::CreateFile(kAppStorageFile));
+
+ NiceMock<app_launch_test::MockAppLaunchSettings> mock_app_launch_settings_;
+ ON_CALL(mock_app_launch_settings_, max_number_of_ios_device())
+ .WillByDefault(Return(15u));
+
+ res_json_.reset(
+ new AppLaunchDataJson(mock_app_launch_settings_, *test_last_state_));
+ }
+
+ public:
+ void TearDown() OVERRIDE {
+ res_json_.get()->Clear();
+ }
+
+ static void SetUpTestCase() {}
+
+ static void TearDownTestCase() {
+ ::file_system::DeleteFile(kAppStorageFile);
+ ::file_system::RemoveDirectory(kAppStorageFolder);
+ }
+
+ AppLaunchDataJson* res_json() {
+ return res_json_.get();
+ }
+
+ void AddApplicationDataWithIncreaseTable(const ApplicationData& data);
+ void AddApplicationDataWithoutIncreaseTable(const ApplicationData& data);
+ TimevalStruct GetApplicationData_EXPECT_TRUE(const ApplicationData& in_data,
+ ApplicationData& out_data);
+ void GetApplicationData_EXPECT_FALSE(const ApplicationData& in_data);
+ std::string AddCounter(const std::string& inp, int32_t val);
+
+ std::auto_ptr<resumption::LastState> test_last_state_;
+ std::auto_ptr<AppLaunchDataJson> res_json_;
+ void SetTimestamp(const ApplicationData& in_data, TimevalStruct& timestamp);
+};
+
+void AppLaunchDataJsonTest::AddApplicationDataWithIncreaseTable(
+ const ApplicationData& data) {
+ uint32_t sizeBeforeAdding = res_json()->GetCurentNumberOfAppData();
+
+ EXPECT_TRUE(res_json()->AddApplicationData(data));
+
+ uint32_t sizeAfterAdding = res_json()->GetCurentNumberOfAppData();
+
+ EXPECT_EQ(sizeBeforeAdding + 1u, sizeAfterAdding);
+}
+
+void AppLaunchDataJsonTest::AddApplicationDataWithoutIncreaseTable(
+ const ApplicationData& data) {
+ uint32_t sizeBeforeAdding = res_json()->GetCurentNumberOfAppData();
+
+ EXPECT_TRUE(res_json()->AddApplicationData(data));
+
+ uint32_t sizeAfterAdding = res_json()->GetCurentNumberOfAppData();
+
+ EXPECT_EQ(sizeBeforeAdding, sizeAfterAdding);
+}
+
+TimevalStruct AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
+ const ApplicationData& in_data, ApplicationData& out_data) {
+ uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
+
+ int32_t index = NotFound;
+ Json::Value& json_data_list =
+ res_json()->GetApplicationListAndIndex(in_data, index);
+ EXPECT_FALSE(index == NotFound);
+
+ uint32_t sizeAfterGetting = res_json()->GetCurentNumberOfAppData();
+
+ EXPECT_EQ(sizeBeforeGetting, sizeAfterGetting);
+ out_data.device_mac_ =
+ json_data_list[index][am::strings::device_id].asString();
+ out_data.mobile_app_id_ =
+ json_data_list[index][am::strings::app_id].asString();
+ out_data.bundle_id_ =
+ json_data_list[index][am::strings::bundle_id].asString();
+ // time stamp
+ TimevalStruct tmVal = {0};
+ tmVal.tv_sec =
+ json_data_list[index][am::strings::app_launch_last_session].asUInt64();
+ return tmVal;
+}
+
+void AppLaunchDataJsonTest::GetApplicationData_EXPECT_FALSE(
+ const ApplicationData& in_data) {
+ uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
+
+ int32_t index = NotFound;
+ res_json()->GetApplicationListAndIndex(in_data, index);
+ EXPECT_TRUE(index == NotFound);
+
+ uint32_t sizeAfterGetting = res_json()->GetCurentNumberOfAppData();
+
+ EXPECT_EQ(sizeBeforeGetting, sizeAfterGetting);
+}
+
+void AppLaunchDataJsonTest::SetTimestamp(const ApplicationData& in_data,
+ TimevalStruct& timestamp) {
+ uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
+
+ int32_t index = NotFound;
+ Json::Value& json_data_list =
+ res_json()->GetApplicationListAndIndex(in_data, index);
+ EXPECT_FALSE(index == NotFound);
+
+ uint32_t sizeAfterGetting = res_json()->GetCurentNumberOfAppData();
+
+ EXPECT_FALSE(index == NotFound);
+
+ EXPECT_EQ(sizeBeforeGetting, sizeAfterGetting);
+ // time stamp
+ json_data_list[index][am::strings::app_launch_last_session] =
+ static_cast<Json::Value::UInt64>(timestamp.tv_sec);
+}
+
+std::string AppLaunchDataJsonTest::AddCounter(const std::string& inp,
+ int32_t val) {
+ std::stringstream ss;
+ ss << inp << val;
+ return ss.str();
+}
+
+TEST_F(AppLaunchDataJsonTest, SaveAndGetData) {
+ ApplicationData data("mobile_app_id", "bundle_id", "device_mac");
+ AddApplicationDataWithIncreaseTable(data);
+ ApplicationData recoveredData("", "", "");
+ GetApplicationData_EXPECT_TRUE(data, recoveredData);
+ EXPECT_TRUE(data == recoveredData);
+}
+
+TEST_F(AppLaunchDataJsonTest, NotAddEmptyAppData) {
+ ApplicationData data1("", "bundle_id", "device_mac");
+ ApplicationData data2("mobile_app_id", "", "device_mac");
+ ApplicationData data3("mobile_app_id", "bundle_id", "");
+ ApplicationData data4("", "", "");
+ EXPECT_FALSE(res_json()->AddApplicationData(data1));
+ EXPECT_FALSE(res_json()->AddApplicationData(data2));
+ EXPECT_FALSE(res_json()->AddApplicationData(data3));
+ EXPECT_FALSE(res_json()->AddApplicationData(data4));
+ EXPECT_EQ(0u, res_json()->GetCurentNumberOfAppData());
+}
+
+TEST_F(AppLaunchDataJsonTest, SaveOneAndGetAnotherData) {
+ ApplicationData data("mobile_app_id", "bundle_id", "device_mac");
+ ApplicationData recoverData = data;
+ AddApplicationDataWithIncreaseTable(data);
+ recoverData.device_mac_ += "test";
+ GetApplicationData_EXPECT_FALSE(recoverData);
+}
+
+TEST_F(AppLaunchDataJsonTest, RefreshTimestamp) {
+ ApplicationData data("mobile_app_id", "bundle_id", "device_mac");
+ AddApplicationDataWithIncreaseTable(data);
+ ApplicationData recoveredData("", "", "");
+ TimevalStruct timestamp1 =
+ GetApplicationData_EXPECT_TRUE(data, recoveredData);
+ TimevalStruct tm = {0, 0};
+ SetTimestamp(data, tm);
+ TimevalStruct timestamp2 =
+ GetApplicationData_EXPECT_TRUE(data, recoveredData);
+ EXPECT_NE(timestamp1.tv_sec, timestamp2.tv_sec);
+ AddApplicationDataWithoutIncreaseTable(data); // again insert the same
+ TimevalStruct timestamp3 =
+ GetApplicationData_EXPECT_TRUE(data, recoveredData);
+ EXPECT_TRUE(data == recoveredData);
+ EXPECT_NE(timestamp2.tv_sec, timestamp3.tv_sec);
+}
+
+TEST_F(AppLaunchDataJsonTest, MaxCount) {
+ const uint32_t max_ios_devs = res_json()->get_max_number_iOS_devs();
+ for (uint32_t i = 0; i < max_ios_devs; i++) {
+ ApplicationData data(AddCounter("mobile_app_id_", i),
+ AddCounter("bundle_id_", i),
+ "device_mac");
+ AddApplicationDataWithIncreaseTable(data);
+ }
+
+ // insert new time stamp
+ ApplicationData changedRecord("mobile_app_id_0", "bundle_id_0", "device_mac");
+ TimevalStruct tm = {0, 0};
+ SetTimestamp(changedRecord, tm);
+
+ uint32_t size_max = res_json()->GetCurentNumberOfAppData();
+ EXPECT_EQ(max_ios_devs, size_max);
+ EXPECT_TRUE(res_json()->AddApplicationData(ApplicationData(
+ "mobile_app_id_last", "bundle_id_last", "device_mac_last")));
+ uint32_t size_after_max = res_json()->GetCurentNumberOfAppData();
+ EXPECT_EQ(size_max, size_after_max);
+ EXPECT_FALSE(res_json()->IsAppDataAlreadyExisted(changedRecord));
+}
+
+TEST_F(AppLaunchDataJsonTest, DeleteAllJsonDataTwice) {
+ for (uint32_t i = 0; i < res_json()->get_max_number_iOS_devs(); i++) {
+ ApplicationData data(AddCounter("mobile_app_id_", i),
+ AddCounter("bundle_id_", i),
+ "device_mac");
+ AddApplicationDataWithIncreaseTable(data);
+ }
+
+ uint32_t full_size = res_json()->GetCurentNumberOfAppData();
+
+ EXPECT_EQ(full_size, res_json()->get_max_number_iOS_devs());
+ EXPECT_TRUE(res_json()->Clear()); // delete data
+ EXPECT_EQ(0u, res_json()->GetCurentNumberOfAppData());
+ EXPECT_TRUE(res_json()->Clear()); // second time delete data
+ EXPECT_EQ(0u, res_json()->GetCurentNumberOfAppData());
+}
+
+namespace {
+bool ApplicationDataComporator(const ApplicationDataPtr& left,
+ const ApplicationDataPtr& right) {
+ return (left->device_mac_ < right->device_mac_ &&
+ left->mobile_app_id_ < right->mobile_app_id_ &&
+ left->bundle_id_ < right->bundle_id_);
+}
+} // namespace
+
+TEST_F(AppLaunchDataJsonTest, SelectMultipleData) {
+ std::vector<ApplicationDataPtr> input_data1;
+ std::vector<ApplicationDataPtr> input_data2;
+ std::vector<ApplicationDataPtr> output_data1;
+ std::vector<ApplicationDataPtr> output_data2;
+ const std::string device_mac_1 = "device_mac_1";
+ const std::string device_mac_2 = "device_mac_2";
+ uint32_t half_part = res_json()->get_max_number_iOS_devs() / 2u;
+
+ for (uint32_t i = 0; i < half_part; i++) {
+ const std::string mobile_app_id = AddCounter("d1_mobile_app_id_", i);
+ const std::string bundle_id = AddCounter("d1_bundle_id_", i);
+
+ ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ mobile_app_id, bundle_id, device_mac_1);
+ AddApplicationDataWithIncreaseTable(*app_data);
+ input_data1.push_back(app_data);
+ }
+
+ for (uint32_t i = 0; i < half_part; i++) {
+ const std::string mobile_app_id = AddCounter("d2_mobile_app_id_", i);
+ const std::string bundle_id = AddCounter("d2_bundle_id_", i);
+
+ ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ mobile_app_id, bundle_id, device_mac_2);
+ AddApplicationDataWithIncreaseTable(*app_data);
+ input_data2.push_back(app_data);
+ }
+
+ output_data1 = res_json()->GetApplicationDataByDevice(device_mac_1);
+ output_data2 = res_json()->GetApplicationDataByDevice(device_mac_2);
+
+ EXPECT_EQ(half_part, output_data1.size());
+ EXPECT_EQ(half_part, output_data2.size());
+
+ std::sort(
+ output_data1.begin(), output_data1.end(), ApplicationDataComporator);
+ std::sort(
+ output_data2.begin(), output_data2.end(), ApplicationDataComporator);
+ std::sort(input_data1.begin(), input_data1.end(), ApplicationDataComporator);
+ std::sort(input_data2.begin(), input_data2.end(), ApplicationDataComporator);
+
+ for (uint32_t i = 0; i < output_data1.size(); i++) {
+ EXPECT_TRUE(*output_data1[i] == *input_data1[i]);
+ }
+
+ for (uint32_t i = 0; i < output_data2.size(); i++) {
+ EXPECT_TRUE(*output_data2[i] == *input_data2[i]);
+ }
+}
+
+} // namespace app_launch
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 7989f11fce..54414a93de 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -31,7 +31,10 @@
*/
#include "application_manager/application_impl.h"
+
+#include <stdint.h>
#include <iostream>
+
#include "gtest/gtest.h"
#include "application_manager/hmi_state.h"
#include "utils/file_system.h"
@@ -47,7 +50,8 @@
#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 "policy/usage_statistics/mock_statistics_manager.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -56,7 +60,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::_;
@@ -475,7 +478,7 @@ TEST_F(ApplicationImplTest, LoadPersistentFiles) {
EXPECT_EQ(FileType::AUDIO_MP3, test_file8->file_type);
}
-TEST_F(ApplicationImplTest, IsCommandLimitsExceeded_SetLimitFromConfig) {
+TEST_F(ApplicationImplTest, AreCommandLimitsExceeded_SetLimitFromConfig) {
std::pair<uint32_t, int32_t> get_frequency;
get_frequency.first = 5;
get_frequency.second = 1;
@@ -484,21 +487,22 @@ TEST_F(ApplicationImplTest, IsCommandLimitsExceeded_SetLimitFromConfig) {
EXPECT_CALL(mock_application_manager_settings_, get_vehicle_data_frequency())
.WillRepeatedly(ReturnRef(get_frequency));
for (uint32_t i = 0; i < get_frequency.first; i++) {
- EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID,
- TLimitSource::CONFIG_FILE));
+ EXPECT_FALSE(app_impl->AreCommandLimitsExceeded(FunctionID::ReadDIDID,
+ TLimitSource::CONFIG_FILE));
}
- EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID,
- TLimitSource::CONFIG_FILE));
+ EXPECT_TRUE(app_impl->AreCommandLimitsExceeded(FunctionID::ReadDIDID,
+ TLimitSource::CONFIG_FILE));
for (uint32_t i = 0; i < get_frequency.first; i++) {
- EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID,
- TLimitSource::CONFIG_FILE));
+ EXPECT_FALSE(app_impl->AreCommandLimitsExceeded(
+ FunctionID::GetVehicleDataID, TLimitSource::CONFIG_FILE));
}
- EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID,
- TLimitSource::CONFIG_FILE));
+ EXPECT_TRUE(app_impl->AreCommandLimitsExceeded(FunctionID::GetVehicleDataID,
+ TLimitSource::CONFIG_FILE));
}
-TEST_F(ApplicationImplTest, IsCommandLimitsExceeded_LimitFromPT) {
+TEST_F(ApplicationImplTest, AreCommandLimitsExceeded_LimitFromPT) {
+ const uint32_t cmd_limit = 100u;
policy_test::MockPolicyHandlerInterface policy_interface;
EXPECT_CALL(mock_application_manager_, GetPolicyHandler())
.WillRepeatedly(ReturnRef(policy_interface));
@@ -506,20 +510,20 @@ TEST_F(ApplicationImplTest, IsCommandLimitsExceeded_LimitFromPT) {
.WillRepeatedly(Return(false));
EXPECT_CALL(policy_interface, GetNotificationsNumber(_))
- .WillOnce(Return(100u));
- EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID,
- TLimitSource::POLICY_TABLE));
+ .WillOnce(Return(cmd_limit));
+ EXPECT_FALSE(app_impl->AreCommandLimitsExceeded(FunctionID::ReadDIDID,
+ TLimitSource::POLICY_TABLE));
EXPECT_CALL(policy_interface, GetNotificationsNumber(_))
- .WillOnce(Return(100u));
- EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID,
- TLimitSource::POLICY_TABLE));
+ .WillOnce(Return(cmd_limit));
+ EXPECT_FALSE(app_impl->AreCommandLimitsExceeded(FunctionID::GetVehicleDataID,
+ TLimitSource::POLICY_TABLE));
EXPECT_CALL(policy_interface, GetNotificationsNumber(_))
.WillRepeatedly(Return(0));
- EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID,
- TLimitSource::POLICY_TABLE));
- EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID,
- TLimitSource::POLICY_TABLE));
+ EXPECT_TRUE(app_impl->AreCommandLimitsExceeded(FunctionID::ReadDIDID,
+ TLimitSource::POLICY_TABLE));
+ EXPECT_TRUE(app_impl->AreCommandLimitsExceeded(FunctionID::GetVehicleDataID,
+ TLimitSource::POLICY_TABLE));
}
TEST_F(ApplicationImplTest, SubscribeToButton_UnsubscribeFromButton) {
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..5b232e1dfc
--- /dev/null
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -0,0 +1,200 @@
+/*
+ * 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 "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_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_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"
+
+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::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::SetArgPointee;
+
+using namespace application_manager;
+
+namespace {
+const std::string kDirectoryName = "./test_storage";
+const uint32_t kTimeout = 10000u;
+sync_primitives::Lock state_lock_;
+sync_primitives::ConditionalVariable state_condition_;
+} // namespace
+
+class ApplicationManagerImplTest : public ::testing::Test {
+ public:
+ ApplicationManagerImplTest()
+ : mock_storage_(
+ ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
+ 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(_, _, _, _))
+ .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(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));
+ app_manager_impl_.reset(new am::ApplicationManagerImpl(
+ mock_application_manager_settings_, mock_policy_settings_));
+
+ ASSERT_TRUE(app_manager_impl_.get());
+ }
+
+ 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 app_mngr_;
+ std::auto_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+ application_manager::MockMessageHelper* mock_message_helper_;
+ uint32_t app_id_;
+ application_manager::MessageHelper* message_helper_;
+};
+
+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) {
+ app_manager_impl_->SubscribeAppForWayPoints(app_id_);
+ EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_id_));
+}
+
+TEST_F(ApplicationManagerImplTest,
+ UnsubscribeAppForWayPoints_ExpectUnsubscriptionApp) {
+ app_manager_impl_->SubscribeAppForWayPoints(app_id_);
+ EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_id_));
+ app_manager_impl_->UnsubscribeAppFromWayPoints(app_id_);
+ EXPECT_FALSE(app_manager_impl_->IsAppSubscribedForWayPoints(app_id_));
+ 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) {
+ app_manager_impl_->SubscribeAppForWayPoints(app_id_);
+ std::set<int32_t> result = app_manager_impl_->GetAppsSubscribedForWayPoints();
+ EXPECT_EQ(1u, result.size());
+ EXPECT_TRUE(result.find(app_id_) != result.end());
+}
+
+} // application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt
new file mode 100644
index 0000000000..e22d1434a7
--- /dev/null
+++ b/src/components/application_manager/test/commands/CMakeLists.txt
@@ -0,0 +1,67 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/include/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/hmi/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/mobile/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ ${COMPONENTS_DIR}/application_manager/test/include/application_manager/
+)
+
+set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/hmi/hmi_notifications/*
+ ${COMMANDS_TEST_DIR}/mobile/*
+)
+
+set(LIBRARIES
+ gmock
+ Utils
+ SmartObjects
+ jsoncpp
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ AMHMICommandsLibrary
+ AMMobileCommandsLibrary
+ connectionHandler
+)
+
+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
new file mode 100644
index 0000000000..fd660af210
--- /dev/null
+++ b/src/components/application_manager/test/commands/command_impl_test.cc
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <algorithm>
+#include <functional>
+#include <set>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace command_impl {
+
+using ::testing::Return;
+using ::testing::AtLeast;
+using ::testing::_;
+
+using ::utils::SharedPtr;
+namespace strings = ::application_manager::strings;
+using ::application_manager::commands::CommandImpl;
+using ::application_manager::ApplicationManager;
+using ::application_manager::commands::MessageSharedPtr;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+typedef SharedPtr<MockApplication> MockAppPtr;
+
+namespace {
+const uint32_t kDefaultMsgCount = 5u;
+const uint32_t kAppId1 = 5u;
+const uint32_t kAppId2 = 10u;
+} // namespace
+
+void ExpectEqualAppId(const smart_objects::SmartObject& obj) {
+ EXPECT_EQ(kAppId2, obj[strings::app_id].asUInt());
+}
+
+void ExpectEqualKeyAppId(const std::string obj, MessageSharedPtr msg) {
+ EXPECT_EQ(kAppId2, (*msg)[obj][strings::app_id].asUInt());
+}
+
+class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ class UnwrappedCommandImpl : CommandImpl {
+ public:
+ using CommandImpl::ReplaceMobileByHMIAppId;
+ using CommandImpl::ReplaceHMIByMobileAppId;
+
+ UnwrappedCommandImpl(const MessageSharedPtr& message,
+ ApplicationManager& application_manager)
+ : CommandImpl(message, application_manager) {}
+ };
+
+ // Create `SmartObject` which handle array of `SmartObjects`
+ static MessageSharedPtr CreateArrayMessage(
+ const size_t msg_count = kDefaultMsgCount) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Array);
+ smart_objects::SmartArray* array = msg->asArray();
+ for (size_t i = 0u; i < msg_count; ++i) {
+ SmartObject obj;
+ obj[strings::app_id] = i;
+ array->push_back(obj);
+ }
+ return msg;
+ }
+ // Create `SmartObject` which handle map of `SmartObjects`
+ static MessageSharedPtr CreateMapMessage(
+ const size_t msg_count = kDefaultMsgCount) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ char key[] = {'A', '\0'};
+ for (size_t i = 0u; i < msg_count; ++i, ++key[0]) {
+ SmartObject obj;
+ obj[strings::app_id] = i;
+ (*msg)[key] = obj;
+ }
+ return msg;
+ }
+};
+
+typedef CommandImplTest::UnwrappedCommandImpl UCommandImpl;
+typedef SharedPtr<UCommandImpl> UCommandImplPtr;
+
+TEST_F(CommandImplTest, GetMethods_SUCCESS) {
+ MessageSharedPtr msg;
+ SharedPtr<CommandImpl> command =
+ CreateCommand<CommandImpl>(kDefaultTimeout_, msg);
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CheckPermissions());
+ EXPECT_TRUE(command->CleanUp());
+
+ // Default value of `allowed_to_terminate_` is true
+ EXPECT_TRUE(command->AllowedToTerminate());
+ command->SetAllowedToTerminate(false);
+ EXPECT_FALSE(command->AllowedToTerminate());
+
+ const uint32_t kCorrelationId = 3u;
+ const int32_t kFunctionId = 4u;
+ const uint32_t kConnectionKey = 5u;
+
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*msg)[strings::params][strings::function_id] = kFunctionId;
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ EXPECT_EQ(kDefaultTimeout_, command->default_timeout());
+ EXPECT_EQ(kCorrelationId, command->correlation_id());
+ EXPECT_EQ(kConnectionKey, command->connection_key());
+ EXPECT_EQ(kFunctionId, command->function_id());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_NO_THROW(command->onTimeOut());
+}
+
+TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_NoAppIdInMessage_UNSUCCESS) {
+ MessageSharedPtr msg;
+ UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
+
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+
+ command->ReplaceMobileByHMIAppId(*msg);
+}
+
+TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::app_id] = kAppId1;
+
+ UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
+
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(kAppId1)).WillOnce(Return(app));
+ ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
+
+ command->ReplaceMobileByHMIAppId(*msg);
+
+ EXPECT_EQ(kAppId2, (*msg)[strings::app_id].asUInt());
+}
+
+TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Array_SUCCESS) {
+ MessageSharedPtr msg = CreateArrayMessage(kDefaultMsgCount);
+ UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
+
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .Times(kDefaultMsgCount)
+ .WillRepeatedly(Return(app));
+ ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
+
+ command->ReplaceMobileByHMIAppId(*msg);
+
+ EXPECT_TRUE(msg->asArray());
+ std::for_each(
+ msg->asArray()->begin(), msg->asArray()->end(), ExpectEqualAppId);
+}
+
+TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Map_SUCCESS) {
+ MessageSharedPtr msg = CreateMapMessage(kDefaultMsgCount);
+ UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
+
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .Times(kDefaultMsgCount)
+ .WillRepeatedly(Return(app));
+ ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
+
+ command->ReplaceMobileByHMIAppId(*msg);
+
+ std::set<std::string> keys(msg->enumerate());
+ std::for_each(keys.begin(),
+ keys.end(),
+ std::bind2nd(std::ptr_fun(&ExpectEqualKeyAppId), msg));
+}
+
+TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_NoHMIAppIdInMessage_UNSUCCESS) {
+ MessageSharedPtr msg;
+ UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).Times(0);
+
+ command->ReplaceHMIByMobileAppId(*msg);
+}
+
+TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::app_id] = kAppId1;
+
+ UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
+
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppId1)).WillOnce(Return(app));
+ ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
+
+ command->ReplaceHMIByMobileAppId(*msg);
+
+ EXPECT_EQ(kAppId2, (*msg)[strings::app_id].asUInt());
+}
+
+TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Array_SUCCESS) {
+ MessageSharedPtr msg = CreateArrayMessage(kDefaultMsgCount);
+
+ UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_))
+ .Times(kDefaultMsgCount)
+ .WillRepeatedly(Return(app));
+ ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
+
+ command->ReplaceHMIByMobileAppId(*msg);
+
+ EXPECT_TRUE(msg->asArray());
+ std::for_each(
+ msg->asArray()->begin(), msg->asArray()->end(), ExpectEqualAppId);
+}
+
+TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Map_SUCCESS) {
+ MessageSharedPtr msg = CreateMapMessage(kDefaultMsgCount);
+
+ UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_))
+ .Times(kDefaultMsgCount)
+ .WillRepeatedly(Return(app));
+ ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
+
+ command->ReplaceHMIByMobileAppId(*msg);
+
+ std::set<std::string> keys = msg->enumerate();
+ std::for_each(keys.begin(),
+ keys.end(),
+ 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
new file mode 100644
index 0000000000..2471ec1165
--- /dev/null
+++ b/src/components/application_manager/test/commands/command_request_impl_test.cc
@@ -0,0 +1,521 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <algorithm>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "utils/lock.h"
+#include "utils/shared_ptr.h"
+#include "utils/data_accessor.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/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/mock_hmi_interface.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace command_request_impl {
+
+namespace am = application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::SaveArg;
+using ::testing::DoAll;
+
+using ::utils::SharedPtr;
+using am::commands::MessageSharedPtr;
+using am::CommandParametersPermissions;
+using am::event_engine::EventObserver;
+using am::commands::CommandImpl;
+using am::commands::CommandRequestImpl;
+using am::ApplicationManager;
+using am::ApplicationSet;
+using am::RPCParams;
+using am::MockHmiInterfaces;
+
+typedef am::commands::CommandRequestImpl::RequestState RequestState;
+
+namespace {
+const uint32_t kConnectionKey = 5u;
+const uint32_t kCorrelationId = 3u;
+const hmi_apis::FunctionID::eType kInvalidFunctionId =
+ hmi_apis::FunctionID::INVALID_ENUM;
+const std::string kPolicyAppId = "Test";
+const mobile_apis::Result::eType kMobResultSuccess =
+ mobile_apis::Result::SUCCESS;
+const std::string kDisallowedParam1 = "disallowed_param1";
+const std::string kDisallowedParam2 = "disallowed_param2";
+const std::string kAllowedParam = "allowed_param";
+const std::string kUndefinedParam = "undefined_params";
+const std::string kMissedParam = "missed_param";
+} // namespace
+
+class CommandRequestImplTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ class UnwrappedCommandRequestImpl : public CommandRequestImpl {
+ public:
+ using CommandRequestImpl::CheckAllowedParameters;
+ using CommandRequestImpl::RemoveDisallowedParameters;
+ using CommandRequestImpl::AddDisallowedParameters;
+ using CommandRequestImpl::HasDisallowedParams;
+
+ UnwrappedCommandRequestImpl(const MessageSharedPtr& message,
+ ApplicationManager& am)
+ : CommandRequestImpl(message, am) {}
+
+ const RequestState current_state() const {
+ return current_state_;
+ }
+ void set_current_state(const RequestState state) {
+ current_state_ = state;
+ }
+
+ CommandParametersPermissions& parameters_permissions() {
+ return parameters_permissions_;
+ }
+
+ CommandParametersPermissions& removed_parameters_permissions() {
+ return removed_parameters_permissions_;
+ }
+ };
+
+ CommandRequestImplTest() {
+ mock_message_helper_ = am::MockMessageHelper::message_helper_mock();
+ }
+ ~CommandRequestImplTest() {
+ mock_message_helper_ = NULL;
+ }
+
+ MockAppPtr InitAppSetDataAccessor(SharedPtr<ApplicationSet>& app_set) {
+ app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set);
+ MockAppPtr app(CreateMockApp());
+ app_set->insert(app);
+ EXPECT_CALL(app_mngr_, applications())
+ .WillOnce(
+ Return(DataAccessor<ApplicationSet>(*app_set, app_set_lock_)));
+ return app;
+ }
+
+ sync_primitives::Lock app_set_lock_;
+ am::MockMessageHelper* mock_message_helper_;
+};
+
+typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl;
+typedef SharedPtr<UCommandRequestImpl> CommandPtr;
+
+TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) {
+ CommandPtr command = CreateCommand<UCommandRequestImpl>();
+
+ // Should be called twice:
+ // First -- on `onTimeOut` method call
+ // Second -- on destruction;
+ EXPECT_CALL(event_dispatcher_, remove_observer(_)).Times(2);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ // If `command` already done, then state should change to `kCompleted`.
+ command->set_current_state(RequestState::kCompleted);
+
+ command->onTimeOut();
+
+ EXPECT_EQ(RequestState::kCompleted, command->current_state());
+}
+
+TEST_F(CommandRequestImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*msg)[strings::params][strings::function_id] = kInvalidFunctionId;
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+
+ MessageSharedPtr dummy_msg(CreateMessage());
+ EXPECT_CALL(*mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(dummy_msg));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(dummy_msg, Command::CommandOrigin::ORIGIN_SDL));
+
+ command->onTimeOut();
+
+ // If `command` not done till now, then state should change to `kTimedOut`
+ // and sent it to application manager to deal with it.
+ EXPECT_EQ(RequestState::kTimedOut, command->current_state());
+}
+
+TEST_F(CommandRequestImplTest, CheckSyntax_SUCCESS) {
+ CommandPtr command = CreateCommand<UCommandRequestImpl>();
+
+ // Checking message syntax.
+ const std::string str1("\t\n");
+ EXPECT_FALSE(command->CheckSyntax(str1, false));
+ const std::string str2("\\n");
+ EXPECT_FALSE(command->CheckSyntax(str2, false));
+ const std::string str3("\\t");
+ EXPECT_FALSE(command->CheckSyntax(str3, false));
+ const std::string str4(" ");
+ EXPECT_FALSE(command->CheckSyntax(str4, false));
+ EXPECT_TRUE(command->CheckSyntax(str4, true));
+}
+
+TEST_F(CommandRequestImplTest, GetMobileResultCode_SUCCESS) {
+ union ResultU {
+ int32_t value_;
+ hmi_apis::Common_Result::eType hmi_;
+ mobile_apis::Result::eType mobile_;
+ };
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>();
+
+ // Run thru all possible accordance
+ // of HMI and Mobile result codes.
+ ResultU result_it;
+ for (result_it.hmi_ = hmi_apis::Common_Result::SUCCESS;
+ result_it.value_ < hmi_apis::Common_Result::TRUNCATED_DATA;
+ ++result_it.value_) {
+ if (result_it.hmi_ != hmi_apis::Common_Result::NO_DEVICES_CONNECTED &&
+ result_it.hmi_ != hmi_apis::Common_Result::NO_APPS_REGISTERED) {
+ EXPECT_EQ(result_it.mobile_,
+ command->GetMobileResultCode(result_it.hmi_));
+ }
+ }
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ command->GetMobileResultCode(
+ hmi_apis::Common_Result::NO_DEVICES_CONNECTED));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ command->GetMobileResultCode(
+ hmi_apis::Common_Result::NO_APPS_REGISTERED));
+ EXPECT_EQ(
+ mobile_apis::Result::GENERIC_ERROR,
+ command->GetMobileResultCode(hmi_apis::Common_Result::TRUNCATED_DATA));
+}
+
+TEST_F(CommandRequestImplTest, BasicMethodsOverloads_SUCCESS) {
+ CommandPtr command = CreateCommand<UCommandRequestImpl>();
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+ EXPECT_NO_THROW(command->Run());
+ am::event_engine::Event event(kInvalidFunctionId);
+ EXPECT_NO_THROW(command->on_event(event));
+}
+
+TEST_F(CommandRequestImplTest, CreateHMINotification_SUCCESS) {
+ CommandPtr command = CreateCommand<UCommandRequestImpl>();
+
+ const std::string kTestParamsKey = "test_msg_params";
+
+ MessageSharedPtr msg_params = CreateMessage();
+ (*msg_params)[kTestParamsKey] = 0;
+
+ MessageSharedPtr result;
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ command->CreateHMINotification(kInvalidFunctionId, *msg_params);
+
+ // Check if message been formed and sent to application manager.
+ EXPECT_TRUE((*result).keyExists(strings::msg_params));
+ EXPECT_TRUE((*result)[strings::msg_params].keyExists(kTestParamsKey));
+}
+
+TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) {
+ CommandPtr command = CreateCommand<UCommandRequestImpl>();
+
+ 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));
+ // Return `true` prevents call of `SendResponse` method;
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ EXPECT_EQ(kCorrelationId,
+ command->SendHMIRequest(kInvalidFunctionId, NULL, false));
+}
+
+TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
+ CommandPtr command = CreateCommand<UCommandRequestImpl>();
+
+ 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));
+ // Return `true` prevents call of `SendResponse` method;
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ EXPECT_CALL(event_dispatcher_, add_observer(_, _, _));
+
+ EXPECT_EQ(kCorrelationId,
+ command->SendHMIRequest(kInvalidFunctionId, NULL, true));
+}
+
+TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) {
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(
+ am::VehicleData::value_type(kMissedParam, am::VehicleDataType::MYKEY));
+
+ EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][kDisallowedParam1] = 0u;
+ (*msg)[strings::msg_params][kDisallowedParam2] = 0u;
+ (*msg)[strings::msg_params][kAllowedParam] = 0u;
+ (*msg)[strings::msg_params][kUndefinedParam] = 0u;
+ (*msg)[strings::msg_params][kMissedParam] = 0u;
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+
+ CommandParametersPermissions& permission = command->parameters_permissions();
+ permission.disallowed_params.insert(kDisallowedParam1);
+ permission.disallowed_params.insert(kDisallowedParam2);
+ permission.allowed_params.insert(kAllowedParam);
+ permission.undefined_params.insert(kUndefinedParam);
+
+ command->RemoveDisallowedParameters();
+
+ EXPECT_FALSE((*msg)[strings::msg_params].keyExists(kDisallowedParam1));
+ EXPECT_FALSE((*msg)[strings::msg_params].keyExists(kDisallowedParam2));
+ EXPECT_FALSE((*msg)[strings::msg_params].keyExists(kUndefinedParam));
+ EXPECT_FALSE((*msg)[strings::msg_params].keyExists(kMissedParam));
+ EXPECT_TRUE((*msg)[strings::msg_params].keyExists(kAllowedParam));
+ EXPECT_TRUE(command->HasDisallowedParams());
+}
+
+TEST_F(CommandRequestImplTest,
+ CheckAllowedParameters_RegisterAppInterface_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::RegisterAppInterfaceID;
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+ EXPECT_TRUE(command->CheckPermissions());
+}
+
+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());
+}
+
+TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params] = 0u;
+
+ 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));
+
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
+ .WillOnce(Return(kMobResultSuccess));
+
+ EXPECT_TRUE(command->CheckPermissions());
+}
+
+TEST_F(CommandRequestImplTest,
+ CheckAllowedParameters_WrongPolicyPermissions_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params] = 0u;
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+
+ 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(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(app_mngr_, SendMessageToMobile(_, _));
+ EXPECT_FALSE(command->CheckPermissions());
+}
+
+ACTION_P(GetArg3, output) {
+ *output = arg3;
+}
+
+TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][kPolicyAppId] = true;
+
+ 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));
+
+ RPCParams params;
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
+ .WillOnce(DoAll(GetArg3(&params), Return(kMobResultSuccess)));
+
+ EXPECT_TRUE(command->CheckPermissions());
+ EXPECT_TRUE(params.end() !=
+ std::find(params.begin(), params.end(), kPolicyAppId));
+}
+
+TEST_F(CommandRequestImplTest, AddDisallowedParameters_SUCCESS) {
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1,
+ am::VehicleDataType::MYKEY));
+
+ EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ MessageSharedPtr msg;
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+
+ command->removed_parameters_permissions().disallowed_params.insert(
+ kDisallowedParam1);
+
+ command->AddDisallowedParameters(*msg);
+
+ EXPECT_TRUE((*msg)[strings::msg_params].keyExists(kDisallowedParam1));
+}
+
+TEST_F(CommandRequestImplTest, SendResponse_TimedOut_UNSUCCESS) {
+ CommandPtr command = CreateCommand<UCommandRequestImpl>();
+
+ command->set_current_state(RequestState::kTimedOut);
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ // Args do not affect on anything in this case;
+ command->SendResponse(true, kMobResultSuccess, NULL, NULL);
+
+ EXPECT_EQ(RequestState::kTimedOut, command->current_state());
+}
+
+TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+
+ EXPECT_TRUE(smart_objects::SmartType_Null == (*msg).getType());
+
+ MessageSharedPtr result;
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ // Args do not affect on anything in this case;
+ command->SendResponse(true, kMobResultSuccess, NULL, NULL);
+
+ EXPECT_EQ(RequestState::kCompleted, command->current_state());
+
+ EXPECT_TRUE(smart_objects::SmartType_Map == (*msg).getType());
+}
+
+TEST_F(CommandRequestImplTest,
+ SendResponse_AddDisallowedParametersToInfo_SUCCESS) {
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1,
+ am::VehicleDataType::MYKEY));
+
+ EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::SubscribeVehicleDataID;
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+
+ command->removed_parameters_permissions().disallowed_params.insert(
+ kDisallowedParam1);
+
+ MessageSharedPtr result;
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ command->SendResponse(true, kMobResultSuccess, NULL, NULL);
+
+ EXPECT_EQ(RequestState::kCompleted, command->current_state());
+
+ EXPECT_TRUE((*result)[strings::msg_params].keyExists(strings::info));
+ EXPECT_FALSE(
+ (*result)[strings::msg_params][strings::info].asString().empty());
+}
+
+} // 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
new file mode 100644
index 0000000000..f95b9a49b2
--- /dev/null
+++ b/src/components/application_manager/test/commands/command_response_impl_test.cc
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace command_response_impl {
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+using ::utils::SharedPtr;
+using ::application_manager::commands::MessageSharedPtr;
+using ::application_manager::commands::CommandResponseImpl;
+
+class CommandResponseImplTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) {
+ SharedPtr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>();
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+ EXPECT_NO_THROW(command->Run());
+}
+
+TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
+ MessageSharedPtr msg;
+ SharedPtr<CommandResponseImpl> command =
+ CreateCommand<CommandResponseImpl>(msg);
+ // Do not have a weight in this case
+ const bool kSuccess = true;
+ const mobile_apis::Result::eType kResultCode =
+ mobile_apis::Result::eType::INVALID_ENUM;
+ const bool kFinalResponse = true;
+
+ // If `msg_params->result_code` exist in message,
+ // then send message to mobile.
+ (*msg)[strings::msg_params][strings::result_code] = kResultCode;
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+
+ command->SendResponse(kSuccess, kResultCode, kFinalResponse);
+}
+
+TEST_F(CommandResponseImplTest,
+ SendResponse_EmptyMessageValidResultCode_SUCCESS) {
+ MessageSharedPtr msg;
+ SharedPtr<CommandResponseImpl> command =
+ CreateCommand<CommandResponseImpl>(msg);
+
+ const bool kSuccess = true;
+ const mobile_apis::Result::eType kResultCode =
+ mobile_apis::Result::eType::SUCCESS;
+ const bool kFinalResponse = true;
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+
+ // If `msg_params->result_code` does not exist in message
+ // and arg `result_code` not equals `INVALID_ENUM`,
+ // then set it to `msg_params->result_code` and send message to mobile.
+ command->SendResponse(kSuccess, kResultCode, kFinalResponse);
+
+ EXPECT_EQ(kResultCode,
+ (*msg)[strings::msg_params][strings::result_code].asInt());
+}
+
+TEST_F(CommandResponseImplTest,
+ SendResponse_EmptyMessageInvalidResultCode_SUCCESS) {
+ MessageSharedPtr msg;
+ SharedPtr<CommandResponseImpl> command =
+ CreateCommand<CommandResponseImpl>(msg);
+
+ const bool kSuccess = true;
+ const mobile_apis::Result::eType kResultCode =
+ mobile_apis::Result::eType::INVALID_ENUM;
+ const bool kFinalResponse = true;
+
+ // If `msg_params->result_code` does not exist in message
+ // and arg `result_code` equals `INVALID_ENUM`,
+ // then if `params->hmi_response::code` exist in message,
+ // then set it to `msg_params->result_code` and send message to mobile.
+ (*msg)[strings::params][hmi_response::code] = mobile_apis::Result::SUCCESS;
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+
+ command->SendResponse(kSuccess, kResultCode, kFinalResponse);
+
+ EXPECT_EQ((*msg)[strings::params][hmi_response::code].asInt(),
+ (*msg)[strings::msg_params][strings::result_code].asInt());
+}
+
+TEST_F(CommandResponseImplTest,
+ SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_SUCCESS) {
+ MessageSharedPtr msg;
+ SharedPtr<CommandResponseImpl> command =
+ CreateCommand<CommandResponseImpl>(msg);
+
+ const mobile_apis::Result::eType kResultCode =
+ mobile_apis::Result::eType::INVALID_ENUM;
+ const bool kFinalResponse = true;
+
+ // If `msg_params->result_code` does not exist in message
+ // and arg `result_code` equals `INVALID_ENUM`,
+ // then if `params->hmi_response::code` does not exist in message,
+ // then if `kSuccess` equals `true`,
+ // then `msg_params->result_code` will be `SUCCESS`
+ const bool kSuccess = true;
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+
+ command->SendResponse(kSuccess, kResultCode, kFinalResponse);
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ (*msg)[strings::msg_params][strings::result_code].asInt());
+}
+
+TEST_F(CommandResponseImplTest,
+ SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_INVALID_ENUM) {
+ MessageSharedPtr msg;
+ SharedPtr<CommandResponseImpl> command =
+ CreateCommand<CommandResponseImpl>(msg);
+
+ const mobile_apis::Result::eType kResultCode =
+ mobile_apis::Result::eType::INVALID_ENUM;
+ const bool kFinalResponse = true;
+
+ // If `msg_params->result_code` does not exist in message
+ // and arg `result_code` equals `INVALID_ENUM`,
+ // then if `params->hmi_response::code` does not exist in message,
+ // then if `kSuccess` equals `false`,
+ // then `msg_params->result_code` will be `INVALID_ENUM`
+ const bool kSuccess = false;
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+
+ command->SendResponse(kSuccess, kResultCode, kFinalResponse);
+
+ EXPECT_EQ(mobile_apis::Result::INVALID_ENUM,
+ (*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/activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc
new file mode 100644
index 0000000000..771d13924c
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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/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 activate_app_request {
+
+using ::testing::_;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::MessageSharedPtr;
+using am::commands::ActivateAppRequest;
+using am::commands::CommandImpl;
+
+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 mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+// TODO(OKozlov) Invastigate 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..0fe76ae16d
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc
@@ -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.
+ */
+
+#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;
+ }
+
+ void SetUp() OVERRIDE {
+ message_helper_mock_ =
+ application_manager::MockMessageHelper::message_helper_mock();
+ }
+
+ am::MockMessageHelper* message_helper_mock_;
+ 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(*message_helper_mock_,
+ 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(*message_helper_mock_,
+ 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..ecdb698c56
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
@@ -0,0 +1,1942 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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"
+
+namespace am = application_manager;
+
+static am::MockMessageHelper* message_helper_mock_;
+
+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::Mock;
+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_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) {
+ message_helper_mock_ =
+ application_manager::MockMessageHelper::message_helper_mock();
+ Mock::VerifyAndClearExpectations(message_helper_mock_);
+ }
+
+ ~HMICommandsNotificationsTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ Mock::VerifyAndClearExpectations(message_helper_mock_);
+ }
+ 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(*message_helper_mock_, 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();
+
+ 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);
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(*message_helper_mock_,
+ 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);
+
+ 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);
+
+ 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(*message_helper_mock_,
+ 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(_, 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(_, 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(*message_helper_mock_,
+ 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(*message_helper_mock_,
+ 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));
+ 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_));
+ 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
new file mode 100644
index 0000000000..e590412204
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <utility>
+
+#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_audio_start_stream_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using commands::MessageSharedPtr;
+using commands::AudioStartStreamRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kHmiAppId = 13u;
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+class AudioStartStreamRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AudioStartStreamRequestTest() {
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(start_stream_retry_amount_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<AudioStartStreamRequest>(msg_);
+ }
+
+ std::pair<uint32_t, int32_t> start_stream_retry_amount_;
+ MessageSharedPtr msg_;
+ SharedPtr<AudioStartStreamRequest> command_;
+ MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+};
+
+TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(AudioStartStreamRequestTest,
+ Run_HmiInterfaceAvailableButNoApp_NoRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_audio_streaming_allowed(true));
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(msg_));
+
+ command_->Run();
+}
+
+} // namespace navi_audio_start_stream_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc
new file mode 100644
index 0000000000..b08bf6e515
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.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 "application_manager/commands/hmi/navi_is_ready_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::NaviIsReadyRequest;
+using am::event_engine::Event;
+
+namespace {
+const hmi_apis::FunctionID::eType kEventID =
+ hmi_apis::FunctionID::Navigation_IsReady;
+} // namespace
+
+typedef SharedPtr<NaviIsReadyRequest> NaviIsReadyRequestPtr;
+
+class NaviIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviIsReadyRequestTest() : command_(CreateCommand<NaviIsReadyRequest>()) {
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(mock_hmi_capabilities_));
+ 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_;
+};
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_HmiInterfaceIsAvailable_NaviCooperatingIsAvailable) {
+ const bool is_hmi_interface_available = true;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::msg_params][am::strings::available] =
+ is_hmi_interface_available;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation,
+ am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_HmiInterfaceIsNotAvailable_NaviCooperatingIsNotAvailable) {
+ const bool is_hmi_interface_available = false;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::msg_params][am::strings::available] =
+ is_hmi_interface_available;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_AvailabilityFieldMissing_NaviCooperatingIsNotAvailable) {
+ const bool is_hmi_interface_available = false;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+} // namespace navi_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc
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_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
new file mode 100644
index 0000000000..8a157c9a0f
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <utility>
+
+#include "application_manager/commands/hmi/navi_start_stream_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_start_stream_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using commands::MessageSharedPtr;
+using commands::NaviStartStreamRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kHmiAppId = 13u;
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+class NaviStartStreamRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviStartStreamRequestTest() {
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(start_stream_retry_amount_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<NaviStartStreamRequest>(msg_);
+ }
+
+ std::pair<uint32_t, int32_t> start_stream_retry_amount_;
+ MessageSharedPtr msg_;
+ SharedPtr<NaviStartStreamRequest> command_;
+ MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+};
+
+TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(NaviStartStreamRequestTest,
+ Run_HmiInterfaceAvailableButNoApp_NoRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_video_streaming_allowed(true));
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(msg_));
+
+ command_->Run();
+}
+
+} // namespace navi_start_stream_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc
new file mode 100644
index 0000000000..91b781c1ff
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_stop_stream_request.h"
+#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_stop_stream_requests {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+namespace {
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+template <typename Command>
+class NaviStopStreamRequestsTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviStopStreamRequestsTest() {
+ ON_CALL(this->app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<Command>(msg_);
+ }
+
+ MessageSharedPtr msg_;
+ SharedPtr<Command> command_;
+ MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+};
+
+typedef testing::Types<commands::AudioStopStreamRequest,
+ commands::NaviStopStreamRequest> RequestCommandsList;
+TYPED_TEST_CASE(NaviStopStreamRequestsTest, RequestCommandsList);
+
+TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(TestFixture::mock_hmi_interfaces_,
+ GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(TestFixture::app_mngr_, SendMessageToHMI(_)).Times(0);
+
+ TestFixture::command_->Run();
+}
+
+TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceAvailable_SentRequest) {
+ EXPECT_CALL(TestFixture::mock_hmi_interfaces_,
+ GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(TestFixture::app_mngr_, SendMessageToHMI(TestFixture::msg_));
+
+ TestFixture::command_->Run();
+}
+
+} // namespace navi_stop_stream_requests
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc
new file mode 100644
index 0000000000..94dd1c6599
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 "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_;
+};
+
+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;
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest,
+ Run_SendNotificationToMobile_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ (*msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+
+ NotificationPtr command(CreateCommand<OnDriverDistractionNotification>(msg));
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction(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));
+
+ const uint32_t app_id = 1u;
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(app_id));
+
+ 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/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..eeae0422d1
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc
@@ -0,0 +1,507 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 am::MockMessageHelper;
+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()
+ : message_helper_mock_(am::MockMessageHelper::message_helper_mock()) {
+ Mock::VerifyAndClearExpectations(message_helper_mock_);
+ }
+
+ ~SDLActivateAppRequestTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ Mock::VerifyAndClearExpectations(message_helper_mock_);
+ }
+
+ 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_;
+ am::MockMessageHelper* message_helper_mock_;
+ 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(am::ProtocolVersion::kV4));
+ ON_CALL(*mock_app, protocol_version())
+ .WillByDefault(Return(am::ProtocolVersion::kV4));
+
+ 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(*message_helper_mock_, 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(am::ProtocolVersion::kV4));
+
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*message_helper_mock_, 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) {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ 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(am::ProtocolVersion::kV4));
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(true));
+
+ EXPECT_CALL(*message_helper_mock_, SendLaunchApp(_, schema, package_name, _));
+
+ command->Run();
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+}
+
+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(am::ProtocolVersion::kV4));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
+
+ EXPECT_CALL(*message_helper_mock_, 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(am::ProtocolVersion::kV4));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*message_helper_mock_, 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..5ef54f7be5
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_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 <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> {
+ public:
+ SDLGetUserFriendlyMessageRequestTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+
+ 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_;
+ MockMessageHelper& mock_message_helper_;
+};
+
+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..f444e45a6c
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc
@@ -0,0 +1,280 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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/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> 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..7e55b8b834
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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"
+
+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> >
+ 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..11162f9a03
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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();
+}
+
+} // 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
new file mode 100644
index 0000000000..2759a8a19e
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_is_ready_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_is_ready_request {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::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;
+
+class UIIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UIIsReadyRequestTest()
+ : command_(CreateCommand<UIIsReadyRequest>())
+ , mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+
+ 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,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_ui_cooperating(is_ui_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillOnce(Return(state));
+
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI();
+ }
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr get_language(CreateMessage());
+ (*get_language)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_language)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, _))
+ .WillOnce(Return(get_language));
+
+ smart_objects::SmartObjectSPtr get_all_language(CreateMessage());
+ (*get_all_language)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_all_language)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages, _))
+ .WillOnce(Return(get_all_language));
+
+ smart_objects::SmartObjectSPtr get_capabilities(CreateMessage());
+ (*get_capabilities)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_capabilities)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetCapabilities, _))
+ .WillOnce(Return(get_capabilities));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*get_language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(get_language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(get_all_language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(get_capabilities));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_ui_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_ui_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ UIIsReadyRequestPtr command_;
+ am::MockHmiInterfaces mock_hmi_interfaces_;
+ MockMessageHelper& mock_message_helper_;
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
+};
+
+TEST_F(UIIsReadyRequestTest,
+ OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_ui_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest,
+ OnEvent_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_ui_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest, OnEvent_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_ui_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_ui_cooperating_available);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest, OnTimeout_SUCCESS) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace ui_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc
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
new file mode 100644
index 0000000000..48293f9a12
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_is_ready_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vi_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::VIIsReadyRequest;
+using am::MockMessageHelper;
+using am::event_engine::Event;
+
+typedef SharedPtr<VIIsReadyRequest> VIIsReadyRequestPtr;
+
+class VIIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ VIIsReadyRequestTest() : command_(CreateCommand<VIIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_vi_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_ivi_cooperating(is_vi_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(
+ am::HmiInterfaces::HMI_INTERFACE_VehicleInfo, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_interface_));
+ EXPECT_CALL(mock_policy_handler_interface_, OnVIIsReady());
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VehicleInfo))
+ .WillOnce(Return(state));
+
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI();
+ }
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr ivi_type;
+ EXPECT_CALL(
+ *(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _))
+ .WillOnce(Return(ivi_type));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(ivi_type));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_vi_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_vi_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ VIIsReadyRequestPtr command_;
+ am::MockHmiInterfaces mock_hmi_interfaces_;
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
+};
+
+TEST_F(VIIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_vi_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_vi_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_vi_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_vi_cooperating_available);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace vi_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc
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
new file mode 100644
index 0000000000..64e5c25546
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_is_ready_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::VRIsReadyRequest;
+using am::MockMessageHelper;
+using am::event_engine::Event;
+
+typedef SharedPtr<VRIsReadyRequest> VRIsReadyRequestPtr;
+
+class VRIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ VRIsReadyRequestTest() : command_(CreateCommand<VRIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_vr_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ const bool is_send_message_by_timeout = false;
+ if (is_send_message_to_hmi) {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillRepeatedly(ReturnRef(mock_hmi_capabilities_));
+ ExpectSendMessagesToHMI(is_send_message_by_timeout);
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ }
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_vr_cooperating(is_vr_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillOnce(Return(state));
+ }
+
+ void ExpectSendMessagesToHMI(bool is_send_message_by_timeout) {
+ if (is_send_message_by_timeout) {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ }
+
+ smart_objects::SmartObjectSPtr language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _))
+ .WillOnce(Return(language));
+ EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(language));
+
+ smart_objects::SmartObjectSPtr support_language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(
+ *(MockMessageHelper::message_helper_mock()),
+ 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()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_vr_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_vr_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ VRIsReadyRequestPtr command_;
+ am::MockHmiInterfaces mock_hmi_interfaces_;
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
+};
+
+TEST_F(VRIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_vr_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_vr_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_vr_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_vr_cooperating_available);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ const bool is_send_message_by_timeout = true;
+ ExpectSendMessagesToHMI(is_send_message_by_timeout);
+ command_->onTimeOut();
+}
+
+} // namespace vr_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc
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/add_command_request_test.cc b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
new file mode 100644
index 0000000000..567c3d32f9
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
@@ -0,0 +1,1115 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/add_command_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "utils/helpers.h"
+#include "utils/make_shared.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace add_command_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using ::testing::_;
+using ::utils::SharedPtr;
+using ::testing::Return;
+using ::testing::Mock;
+using ::testing::InSequence;
+using am::commands::AddCommandRequest;
+using NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr;
+using ::test::components::application_manager_test::MockApplication;
+using am::event_engine::EventObserver;
+using namespace smart_objects;
+
+namespace custom_str = utils::custom_string;
+namespace strings = ::application_manager::strings;
+namespace mobile_result = mobile_apis::Result;
+namespace hmi_response = ::application_manager::hmi_response;
+namespace hmi_request = ::application_manager::hmi_request;
+using namespace strings;
+
+namespace {
+const hmi_apis::FunctionID::eType kInvalidFunctionId =
+ hmi_apis::FunctionID::INVALID_ENUM;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const std::string kMenuName = "LG";
+const uint32_t kFirstParentId = 10u;
+const uint32_t kSecondParentId = 1u;
+const std::string kErroredVRCommand = "l\namer";
+const std::string kFirstVrCommand = "lamer";
+const std::string kSecondVrCommand = "hacker";
+const uint32_t kFirstCommandId = 10u;
+const uint32_t kSecondCommandId = 11u;
+const int32_t kType = 34;
+const int32_t kGrammarId = 12;
+const int32_t kPosition = 10;
+} // namespace
+
+class AddCommandRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AddCommandRequestTest()
+ : msg_(CreateMessage())
+ , default_app_name_("test_default_app_name_")
+ , mock_message_helper_(*MockMessageHelper::message_helper_mock())
+ , mock_app_(CreateMockApp()) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ InitGetters();
+ InitBasicMessage();
+ }
+
+ ~AddCommandRequestTest() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ protected:
+ void InitBasicMessage() {
+ (*msg_)[params][connection_key] = kConnectionKey;
+ (*msg_)[msg_params][app_id] = kAppId;
+ (*msg_)[msg_params][app_name] = default_app_name_;
+ }
+
+ void InitGetters() {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, FindCommand(kCmdId))
+ .WillByDefault(Return(so_ptr_.get()));
+ }
+
+ void CreateBasicParamsUIRequest() {
+ SmartObject menu_params = SmartObject(SmartType_Map);
+ menu_params[position] = kPosition;
+ menu_params[menu_name] = kMenuName;
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[cmd_id] = kCmdId;
+ msg_params[strings::menu_params] = menu_params;
+ msg_params[cmd_icon] = 1;
+ msg_params[cmd_icon][value] = "10";
+ msg_params[info] = "UI info";
+ }
+
+ void CreateBasicParamsVRRequest() {
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[cmd_id] = kCmdId;
+ msg_params[vr_commands] = SmartObject(SmartType_Array);
+ msg_params[vr_commands][0] = kFirstVrCommand;
+ msg_params[type] = kPosition;
+ msg_params[grammar_id] = kGrammarId;
+ msg_params[info] = "VR info";
+ }
+
+ const am::CommandsMap CreateCommandsMap(SmartObject& first_command,
+ SmartObject& second_command) {
+ second_command[menu_params] = SmartObject(SmartType_Map);
+ second_command[menu_params][hmi_request::parent_id] = kFirstParentId;
+ second_command[menu_params][menu_name] = kMenuName;
+ second_command[vr_commands] = SmartObject(SmartType_Array);
+ second_command[vr_commands][0] = kSecondVrCommand;
+ am::CommandsMap commands_map;
+ commands_map.insert(std::make_pair(kFirstCommandId, &first_command));
+ commands_map.insert(std::make_pair(kSecondCommandId, &second_command));
+ return commands_map;
+ }
+
+ void CheckOnTimeOutCommandDeletion(
+ const hmi_apis::FunctionID::eType incoming_cmd,
+ const hmi_apis::FunctionID::eType cmd_to_delete) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId))
+ .WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_)));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ Event event(incoming_cmd);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(HMIResultCodeIs(cmd_to_delete)))
+ .WillOnce(Return(true));
+ SmartObjectSPtr response;
+ 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_;
+ am::MockMessageHelper& mock_message_helper_;
+ sync_primitives::Lock lock_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(AddCommandRequestTest, Run_AppNotExisted_EXPECT_AppNotRegistered) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_MenuNameHasSyntaxError_EXPECT_INVALID_DATA) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
+ const std::string errored_menu_name = "L\nG";
+ msg_params[menu_params][menu_name] = errored_menu_name;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ SmartObject parent = SmartObject(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kFirstParentId))
+ .WillOnce(Return(&parent));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_VRCommandsHaveSyntaxError_EXPECT_INVALID_DATA) {
+ CreateBasicParamsVRRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[vr_commands][0] = kErroredVRCommand;
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_CMDIconHasError_EXPECT_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMessage();
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ (*msg)[params][connection_key] = kConnectionKey;
+ msg_params[cmd_id] = kCmdId;
+ msg_params[cmd_icon] = 1;
+ const std::string errored_cmd_icon_value = "1\n0";
+ msg_params[cmd_icon][value] = errored_cmd_icon_value;
+ msg_params[vr_commands][0] = kFirstVrCommand;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_CommandIDAlreadyExists_EXPECT_INVALID_ID) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CommandNameAlreadyExists_EXPECT_DUPLICATE_NAME) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsgParentIDsAreDifferentSubmenuNotExisted_EXPECT_INVALID_ID) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsgVrSynonymsAreTheSame_EXPECT_DUPLICATE_NAME) {
+ CreateBasicParamsVRRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ msg_params[vr_commands][0] = kSecondVrCommand;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_MsgDataEmpty_EXPECT_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[params][connection_key] = kConnectionKey;
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ msg_params[app_id] = kAppId;
+ msg_params[cmd_id] = kCmdId;
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsg_UI_and_Vr_AreCorrect_EXPECT_VR_AND_UI_SENT) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) {
+ CreateBasicParamsUIRequest();
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) {
+ CreateBasicParamsUIRequest();
+ (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
+
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::SUCCESS))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) {
+ CreateBasicParamsVRRequest();
+ MessageSharedPtr msg = CreateMessage(SmartType_Map);
+ (*msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ (*msg)[msg_params][cmd_id] = kCmdId;
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg);
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::SUCCESS))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_VR_DeleteCommand) {
+ CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::VR_AddCommand,
+ hmi_apis::FunctionID::VR_DeleteCommand);
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_UI_DeleteCommand) {
+ CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::UI_AddCommand,
+ hmi_apis::FunctionID::UI_DeleteCommand);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) {
+ MessageSharedPtr command_msg = CreateMessage(SmartType_Map);
+ (*command_msg)[params][connection_key] = kConnectionKey;
+ MessageSharedPtr event_msg = CreateMessage(SmartType_Map);
+ (*event_msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[msg_params][cmd_id] = kCmdId;
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*event_msg);
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
+
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(command_msg);
+ request_ptr->Run();
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_AppNotExisted_UNSUCCESS) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_HmiResponseCodeIsRejected_ExpectUICommandRemoved) {
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::REJECTED;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::REJECTED))
+ .WillOnce(Return(mobile_apis::Result::REJECTED));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::REJECTED), _));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_HmiResponseCodeIsWarnings_ExpectCommandUpdated) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::WARNINGS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::WARNINGS), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_HmiResponseCodeIsGenericError_VR_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::GENERIC_ERROR))
+ .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
+ (*msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_vr)[msg_params][cmd_id] = kCmdId;
+ event_vr.set_smart_object(*msg_vr);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_VR_HmiResponseCodeIsGenericError_UI_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::GENERIC_ERROR))
+ .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_vr);
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
+ (*msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_ui)[msg_params][cmd_id] = kCmdId;
+ event_ui.set_smart_object(*msg_ui);
+ request_ptr->on_event(event_ui);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_UI_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_VR_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_VR_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_UI_EventWithNotSuccesResponseCode_ExpectVRCommandDelete) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
+ (*msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+ (*msg_ui)[msg_params][cmd_id] = kCmdId;
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_ui);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::ABORTED))
+ .WillOnce(Return(mobile_apis::Result::ABORTED));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_UI_VR_Events_VRErrorPresent_ExpectRemoveCommand) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::ABORTED))
+ .WillOnce(Return(mobile_apis::Result::ABORTED));
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
+ (*msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+ (*msg_vr)[msg_params][cmd_id] = kCmdId;
+ event_vr.set_smart_object(*msg_vr);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnTimeOut_AppNotExisted_NoAppRemoveCommandCalled) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
+ SmartObjectSPtr response;
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ response, am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ utils::SharedPtr<CommandRequestImpl> base_class_request =
+ static_cast<utils::SharedPtr<CommandRequestImpl> >(
+ CreateCommand<AddCommandRequest>(msg_));
+ base_class_request->onTimeOut();
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ SmartObjectSPtr response;
+ 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
new file mode 100644
index 0000000000..95bcede5fa
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "application_manager/commands/mobile/add_sub_menu_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace add_sub_menu_request {
+
+namespace am = ::application_manager;
+using am::commands::AddSubMenuRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockHmiInterfaces;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+
+typedef SharedPtr<AddSubMenuRequest> AddSubMenuPtr;
+
+namespace {
+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_;
+};
+
+TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ const uint32_t menu_id = 10u;
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::menu_id] = menu_id;
+
+ utils::SharedPtr<AddSubMenuRequest> command =
+ CreateCommand<AddSubMenuRequest>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app, AddSubMenu(menu_id, _));
+ EXPECT_CALL(*mock_app, UpdateHash());
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ Event event(hmi_apis::FunctionID::UI_AddSubMenu);
+ event.set_smart_object(*ev_msg);
+
+ 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->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+} // namespace add_sub_menu_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc
new file mode 100644
index 0000000000..a835239a90
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc
@@ -0,0 +1,279 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "event_engine/event.h"
+#include "application_manager/commands/mobile/alert_maneuver_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace alert_maneuver_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::AlertManeuverRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockHmiInterfaces;
+using am::MockMessageHelper;
+
+typedef SharedPtr<AlertManeuverRequest> CommandPtr;
+
+class AlertManeuverRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] = hmi_response;
+ (*response)[am::strings::msg_params][am::strings::info] = "test";
+
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*response);
+
+ utils::SharedPtr<AlertManeuverRequest> command =
+ CreateCommand<AlertManeuverRequest>(response);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ 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(_))
+ .WillRepeatedly(Return(state));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+ command->on_event(event);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ success);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+
+ protected:
+ NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_;
+};
+
+TEST_F(AlertManeuverRequestTest, Run_RequiredFieldsDoesNotExist_UNSUCCESS) {
+ CommandPtr command(CreateCommand<AlertManeuverRequest>());
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks] = 0;
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(policy_interface_));
+
+ const mobile_apis::Result::eType kProcessingResult =
+ mobile_apis::Result::ABORTED;
+
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()),
+ ProcessSoftButtons(_, _, _, _))
+ .WillOnce(Return(kProcessingResult));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(kProcessingResult,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_IsWhiteSpaceExist_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks] =
+ SmartObject(smart_objects::SmartType_Array);
+
+ SmartObject tts_chunk(smart_objects::SmartType_Map);
+ tts_chunk[am::strings::text] = "wrong chunk syntax\t\n";
+
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks].asArray()->push_back(
+ tts_chunk);
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(policy_interface_));
+
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()),
+ 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(_))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS));
+ EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()),
+ SubscribeApplicationToSoftButton(_, _, _));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
+ EXPECT_EQ(hmi_apis::FunctionID::Navigation_AlertManeuver,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
+ CommandPtr command(CreateCommand<AlertManeuverRequest>());
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_ENUM,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case1) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case2) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE,
+ true);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case3) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ true);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case4) {
+ CheckExpectations(hmi_apis::Common_Result::GENERIC_ERROR,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ false);
+}
+
+} // namespace alert_maneuver_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_request_test.cc
new file mode 100644
index 0000000000..43151c2d98
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/alert_request_test.cc
@@ -0,0 +1,814 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/alert_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace alert_request {
+
+namespace am = application_manager;
+using am::commands::AlertRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using 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())
+ , msg_(CreateMessage()) {}
+
+ protected:
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ 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_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ }
+
+ void Expectations() {
+ (*msg_)[am::strings::params][am::strings::function_id] = kFunctionId;
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(
+ *mock_app_,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+ 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_;
+
+ MockMessageHelper& mock_message_helper_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+};
+
+TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) {
+ PreConditions();
+ MessageSharedPtr command_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*command_msg)[am::strings::msg_params][am::strings::success] = false;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ utils::SharedPtr<AlertRequest> command = CreateCommand<AlertRequest>();
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(command_msg));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->onTimeOut();
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ PreConditions();
+ MessageSharedPtr command_msg = CreateFullParamsUISO();
+ (*command_msg)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = 10u;
+ (*command_msg)[am::strings::msg_params][am::strings::menu_params]
+ [am::strings::menu_name] = "menu_name";
+
+ utils::SharedPtr<AlertRequest> command =
+ CreateCommand<AlertRequest>(command_msg);
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ 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;
+ Event event_vr(hmi_apis::FunctionID::TTS_Speak);
+ event_vr.set_smart_object(*msg_tts);
+
+ command->on_event(event_vr);
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+class CallOnTimeOut {
+ public:
+ CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+
+ void operator()() {
+ command_.onTimeOut();
+ }
+
+ CommandRequestImpl& command_;
+};
+
+TEST_F(AlertRequestTest, Init_DurationExists_SUCCESS) {
+ Expectations();
+ (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(AlertRequestTest, Init_DurationNotExists_SUCCESS) {
+ Expectations();
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(AlertRequestTest, OnTimeOut_UNSUCCESS) {
+ Expectations();
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->onTimeOut();
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+}
+
+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_);
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ 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_);
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ 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_);
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ command->on_event(tts_stop_event);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ 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_);
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ 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_);
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ 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_);
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ 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_);
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, Run_InvalidAlert2_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
+ "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_InvalidAlert3_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text3] =
+ "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_InvalidTTSChunk_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+} // namespace alert_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/test/commands/mobile/change_registration_test.cc
new file mode 100644
index 0000000000..0c76a08fe9
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/change_registration_test.cc
@@ -0,0 +1,546 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/change_registration_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "utils/helpers.h"
+#include "utils/make_shared.h"
+#include "utils/custom_string.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace change_registration_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using 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;
+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;
+} // namespace
+
+class ChangeRegistrationRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ChangeRegistrationRequestTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock())
+ , mock_app_(CreateMockApp())
+ , supported_languages_(CreateMessage(smart_objects::SmartType_Array)) {}
+
+ MessageSharedPtr CreateMsgFromMobile() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::hmi_display_language] = mobile_apis::Language::EN_US;
+ msg_params[strings::language] = mobile_apis::Language::EN_US;
+ (*msg)[strings::msg_params] = msg_params;
+ return msg;
+ }
+ void PrepareExpectationBeforeRun() {
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(hmi_capabilities_));
+ (*supported_languages_)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+ EXPECT_CALL(hmi_capabilities_, ui_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(hmi_interfaces_));
+ EXPECT_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ EXPECT_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ EXPECT_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ }
+
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success,
+ const hmi_apis::Common_Result::eType ui_hmi_response =
+ hmi_apis::Common_Result::WARNINGS,
+ 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();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(1));
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+ PrepareExpectationBeforeRun();
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(ui_response, ui_hmi_response, "ui_info");
+ CreateResponseFromHMI(vr_response, vr_hmi_response, "unsupported_resource");
+
+ (*tts_response)[strings::params][hmi_response::code] = hmi_response;
+ (*tts_response)[strings::msg_params] = 0;
+
+ 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);
+ am::event_engine::Event event_vr(
+ hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_ui);
+ command->on_event(event_vr);
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ success);
+ EXPECT_EQ((*response_to_mobile)[strings::msg_params][strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+
+ void CreateResponseFromHMI(MessageSharedPtr msg,
+ hmi_apis::Common_Result::eType result,
+ const std::string& info) {
+ (*msg)[strings::params][hmi_response::code] = static_cast<int32_t>(result);
+ (*msg)[strings::msg_params][strings::info] = info;
+ }
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, hmi_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())
+ .WillOnce(Return(supported_languages.get()));
+ EXPECT_CALL(hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages.get()));
+ EXPECT_CALL(hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages.get()));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+ sync_primitives::Lock app_set_lock_;
+ MockHMICapabilities hmi_capabilities_;
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ MockMessageHelper& mock_message_helper_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr supported_languages_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+ utils::SharedPtr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ smart_objects::SmartObjectSPtr supported_languages(
+ CreateMessage(smart_objects::SmartType_Array));
+ (*supported_languages)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+
+ ExpectationsHmiCapabilities(supported_languages);
+
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
+
+ ON_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(
+ ui_response, hmi_apis::Common_Result::WARNINGS, "ui_info");
+ CreateResponseFromHMI(vr_response,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ "VR is not supported by system");
+ CreateResponseFromHMI(
+ tts_response, hmi_apis::Common_Result::SUCCESS, "tts_info");
+ (*ui_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*vr_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*tts_response)[am::strings::msg_params][am::strings::app_id] =
+ kConnectionKey;
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event_ui.set_smart_object(*ui_response);
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ MockHmiInterfaces hmi_interfaces;
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(hmi_interfaces));
+ EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_ui);
+ command->on_event(event_tts);
+ command->on_event(event_vr);
+
+ ResultCommandExpectations(response_to_mobile,
+ "ui_info, VR is not supported by system, tts_info");
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE,
+ true);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_RESPONSE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ false);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_SUCCESS_STATE_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_SUCCESS_STATE_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::SUCCESS,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_WRONG_LANGUAGE_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::WRONG_LANGUAGE,
+ mobile_apis::Result::SUCCESS,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_INVALID_DATA_STATE_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::INVALID_DATA,
+ mobile_apis::Result::SUCCESS,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+
+ utils::SharedPtr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ smart_objects::SmartObjectSPtr supported_languages(
+ CreateMessage(smart_objects::SmartType_Array));
+ (*supported_languages)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+
+ ExpectationsHmiCapabilities(supported_languages);
+
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .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_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ ON_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(ui_response,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ "unsupported_resource");
+ CreateResponseFromHMI(
+ vr_response, hmi_apis::Common_Result::WARNINGS, "vr_info");
+ CreateResponseFromHMI(
+ tts_response, hmi_apis::Common_Result::SUCCESS, "tts_info");
+ (*ui_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*vr_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*tts_response)[am::strings::msg_params][am::strings::app_id] =
+ kConnectionKey;
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event_ui.set_smart_object(*ui_response);
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+ command->on_event(event_tts);
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "unsupported_resource, vr_info, tts_info");
+}
+
+} // namespace change_registration_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc
new file mode 100644
index 0000000000..a0b0dc32ff
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc
@@ -0,0 +1,827 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
+#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "utils/helpers.h"
+#include "utils/make_shared.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace create_interaction_choice_set_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using 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;
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kGrammarId = 10u;
+const int32_t kMenuId = 5;
+const uint32_t kChoiceSetId = 1u;
+const uint32_t kChoiceId1 = 2u;
+const uint32_t kChoiceId2 = 3u;
+const std::string kImage = "image";
+const std::string kSecondImage = "second_image";
+const std::string kVrCommands1 = "vr_commands_1";
+const std::string kVrCommands2 = "vr_commands_2";
+const std::string kMenuName = "menu_name";
+
+} // namespace
+
+class CreateInteractionChoiceSetRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ CreateInteractionChoiceSetRequestTest()
+ : message_helper_mock_(*am::MockMessageHelper::message_helper_mock())
+ , message_(CreateMessage())
+ , command_(CreateCommand<CreateInteractionChoiceSetRequest>(message_))
+ , app_(CreateMockApp()) {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ }
+ ~CreateInteractionChoiceSetRequestTest() {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ }
+
+ MessageSharedPtr CreateFullParamsVRSO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = kCmdId;
+ msg_params[strings::vr_commands] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands][0] = "lamer";
+ msg_params[strings::type] = 34;
+ msg_params[strings::grammar_id] = 12;
+ msg_params[strings::app_id] = kAppId;
+ (*msg)[strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void FillMessageFieldsItem1(MessageSharedPtr message) {
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ }
+ void FillMessageFieldsItem2(MessageSharedPtr message) {
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands2;
+ (*message)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id] = kChoiceSetId;
+ }
+
+ MockMessageHelper& message_helper_mock_;
+ MessageSharedPtr message_;
+ CreateInteractionChoiceSetRequestPtr command_;
+ MockAppPtr app_;
+ sync_primitives::Lock lock_;
+};
+
+class CreateInteractionChoiceSetResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
+ MessageSharedPtr msg_vr = CreateMessage(smart_objects::SmartType_Map);
+ (*msg_vr)[strings::msg_params][strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*msg_vr)[strings::msg_params][strings::success] = false;
+
+ utils::SharedPtr<CreateInteractionChoiceSetRequest> req_vr =
+ CreateCommand<CreateInteractionChoiceSetRequest>();
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, RemoveCommand(_)).WillByDefault(Return());
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ req_vr->onTimeOut();
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsVRSO();
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::choice_id] =
+ 10;
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::menu_name] =
+ "menu_name";
+ (*msg_vr)[strings::msg_params][strings::interaction_choice_set_id] = 11;
+ utils::SharedPtr<CreateInteractionChoiceSetRequest> req_vr =
+ CreateCommand<CreateInteractionChoiceSetRequest>(msg_vr);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ smart_objects::SmartObject* null_obj = NULL;
+ ON_CALL(*mock_app, FindChoiceSet(_)).WillByDefault(Return(null_obj));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[strings::msg_params][strings::info] = "VR is not supported by system";
+ (*msg)[strings::msg_params][strings::cmd_id] = kCommandId;
+
+ am::event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg);
+
+ smart_objects::SmartObject* ptr = NULL;
+ ON_CALL(*mock_app, FindCommand(kCmdId)).WillByDefault(Return(ptr));
+ EXPECT_EQ(NULL, ptr);
+
+ 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())
+ .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(_))
+ .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();
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ req_vr->on_event(event);
+
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*vr_command_result)[strings::msg_params].keyExists(strings::info)) {
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::info].asString(),
+ (*msg)[strings::msg_params][strings::info].asString());
+ }
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_VerifyImageFail_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image] = kSecondImage;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(message_helper_mock_, 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(app_));
+ EXPECT_CALL(message_helper_mock_, 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(*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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*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(*app_, FindChoiceSet(kChoiceSetId))
+ .WillRepeatedly(Return(choice_set_id));
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+
+ EXPECT_CALL(message_helper_mock_, 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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(*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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*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(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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*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(*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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*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(*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(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*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_);
+
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+ command_->on_event(event);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*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(app_));
+
+ EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillRepeatedly(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID())
+ .WillRepeatedly(Return(kGrammarId));
+ EXPECT_CALL(*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
new file mode 100644
index 0000000000..1e03dcaaf1
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "application_manager/commands/mobile/delete_command_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_command_request {
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::DeleteCommandRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+
+typedef SharedPtr<DeleteCommandRequest> DeleteCommandPtr;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class DeleteCommandRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteCommandRequestTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock())
+ , mock_app_(CreateMockApp()) {}
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateFullParamsVRSO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::vr_commands] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[am::strings::vr_commands][0] = "lamer";
+ msg_params[am::strings::type] = 34;
+ msg_params[am::strings::grammar_id] = 12;
+ msg_params[am::strings::app_id] = kAppId;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(hmi_interfaces_));
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ MockMessageHelper& mock_message_helper_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(DeleteCommandRequestTest,
+ OnEvent_VrHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr command_msg = CreateFullParamsVRSO();
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DeleteCommandPtr command(CreateCommand<DeleteCommandRequest>(command_msg));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ MessageSharedPtr test_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*test_msg)[am::strings::vr_commands] = 0;
+ (*test_msg)[am::strings::menu_params] = 0;
+
+ ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ ON_CALL(*mock_app_, FindCommand(kCommandId))
+ .WillByDefault(Return(test_msg.get()));
+ ON_CALL(*mock_app_, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
+ event_ui.set_smart_object(*msg);
+
+ command->Run();
+ command->on_event(event_ui);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::msg_params][am::strings::info] =
+ "VR is not supported by system";
+ Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
+ event_vr.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCommandId));
+
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ command->on_event(event_vr);
+
+ ResultCommandExpectations(vr_command_result, "VR is not supported by system");
+}
+
+TEST_F(DeleteCommandRequestTest,
+ OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr command_msg = CreateFullParamsUISO();
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DeleteCommandPtr command(CreateCommand<DeleteCommandRequest>(command_msg));
+
+ MockAppPtr app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ MessageSharedPtr test_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*test_msg)[am::strings::vr_commands] = 0;
+ (*test_msg)[am::strings::menu_params] = 0;
+
+ ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ ON_CALL(*app, FindCommand(kCommandId)).WillByDefault(Return(test_msg.get()));
+ ON_CALL(*app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
+ event_vr.set_smart_object(*msg);
+
+ command->Run();
+ command->on_event(event_vr);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+ Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
+ event_ui.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*app, RemoveCommand(kCommandId));
+
+ EXPECT_CALL(*app, UpdateHash());
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event_ui)));
+
+ ASSERT_TRUE(result_msg);
+
+ ResultCommandExpectations(result_msg, "UI is not supported by system");
+}
+
+} // namespace delete_command_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/test/commands/mobile/delete_file_test.cc
new file mode 100644
index 0000000000..6af9a62bf0
--- /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))
+ .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));
+
+ 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..64c2fae1d3
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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::Mock;
+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;
+
+ InSequence seq;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ 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());
+
+ command_->Run();
+ EXPECT_TRUE(Mock::VerifyAndClearExpectations(app_.get()));
+}
+
+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]);
+
+ InSequence seq;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ 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());
+
+ command_->Run();
+ EXPECT_TRUE(Mock::VerifyAndClearExpectations(app_.get()));
+}
+
+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
new file mode 100644
index 0000000000..dd57d5f8c6
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc
@@ -0,0 +1,349 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "application_manager/commands/mobile/delete_sub_menu_request.h"
+#include "application_manager/commands/mobile/delete_sub_menu_response.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_sub_menu_request {
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::InSequence;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockHmiInterfaces;
+using am::MockMessageHelper;
+
+using am::commands::DeleteSubMenuRequest;
+using am::commands::DeleteSubMenuResponse;
+
+typedef SharedPtr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr;
+typedef SharedPtr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr;
+
+MATCHER_P(CheckMessageResultCode, result_code, "") {
+ return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ result_code;
+}
+
+MATCHER_P(CheckMessageConnectionKey, connection_key, "") {
+ return (*arg)[am::strings::msg_params][am::strings::connection_key].asInt() ==
+ connection_key;
+}
+
+ACTION_P(DeleteCommand, commands_map) {
+ am::CommandsMap::iterator it = (*commands_map).begin();
+ if ((*commands_map).end() != it) {
+ (*commands_map).erase(it);
+ }
+}
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kMenuId = 100u;
+const uint32_t kGrammarId = 101u;
+const int32_t kCmdId = 102;
+} // namespace
+
+class DeleteSubMenuRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteSubMenuRequestTest()
+ : accessor_(commands_map_, commands_lock_)
+ , mock_message_helper_(*MockMessageHelper::message_helper_mock())
+ , message_(CreateMessage())
+ , command_(CreateCommand<DeleteSubMenuRequest>(message_))
+ , app_(CreateMockApp()) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ ~DeleteSubMenuRequestTest() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ am::CommandsMap commands_map_;
+ mutable sync_primitives::Lock commands_lock_;
+ DataAccessor<am::CommandsMap> accessor_;
+
+ MockMessageHelper& mock_message_helper_;
+ MessageSharedPtr message_;
+ DeleteSubMenuRequestPtr command_;
+ MockAppPtr app_;
+};
+
+class DeleteSubMenuResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::menu_id] = 10u;
+
+ utils::SharedPtr<DeleteSubMenuRequest> command =
+ CreateCommand<DeleteSubMenuRequest>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app, RemoveSubMenu(_));
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ event.set_smart_object(*ev_msg);
+
+ MockHmiInterfaces hmi_interfaces;
+ ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
+ EXPECT_CALL(hmi_interfaces,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ 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));
+ sync_primitives::Lock lock;
+ DataAccessor<am::CommandsMap> accessor(commands_map, lock);
+ EXPECT_CALL(*mock_app, commands_map())
+ .WillOnce(Return(accessor))
+ .WillOnce(Return(accessor));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(CheckMessageResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_, FindSubMenu(_)).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_FindSubMenuFalse_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject* invalid_sub_menu = NULL;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(invalid_sub_menu));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ CheckMessageResultCode(mobile_apis::Result::INVALID_ID),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_, app_id()).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_SendHMIRequest_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject* sub_menu =
+ &((*message_)[am::strings::msg_params][am::strings::menu_id]);
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(sub_menu));
+
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_UnknownEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_InvalidApp_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ am::mobile_api::Result::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;
+ ON_CALL(mock_message_helper_, HMIToMobileResult(result_code))
+ .WillByDefault(Return(am::mobile_api::Result::SUCCESS));
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ std::make_pair(0, &((*message_)[am::strings::msg_params])));
+
+ InSequence seq;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ 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());
+ command_->on_event(event);
+ EXPECT_TRUE(Mock::VerifyAndClearExpectations(app_.get()));
+}
+
+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(_)).WillOnce(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(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
+ EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+
+ command_->on_event(event);
+}
+
+} // namespace delete_sub_menu_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc
new file mode 100644
index 0000000000..60697446f2
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc
@@ -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.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/mobile/diagnostic_message_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace diagnostic_message_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::DiagnosticMessageRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef SharedPtr<DiagnosticMessageRequest> DiagnosticMessageRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kDiagnosticMode = 5u;
+} // namespace
+
+class DiagnosticMessageRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DiagnosticMessageRequestTest()
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock()) {
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+ ~DiagnosticMessageRequestTest() {
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+ am::MockMessageHelper& mock_message_helper_;
+};
+
+TEST_F(DiagnosticMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, Run_NotSupportedDiagnosticMode_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::message_data][0] =
+ kDiagnosticMode;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ const std::vector<uint32_t> empty_supported_diag_modes;
+ EXPECT_CALL(app_mngr_settings_, supported_diag_modes())
+ .WillOnce(ReturnRef(empty_supported_diag_modes));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::REJECTED), _));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::message_data][0] =
+ kDiagnosticMode;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ std::vector<uint32_t> supported_diag_modes;
+ supported_diag_modes.push_back(kDiagnosticMode);
+
+ EXPECT_CALL(app_mngr_settings_, supported_diag_modes())
+ .WillOnce(ReturnRef(supported_diag_modes));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage)));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, OnEvent_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>());
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(DiagnosticMessageRequestTest, OnEvent_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
+
+ MessageSharedPtr event_message(CreateMessage(smart_objects::SmartType_Map));
+ (*event_message)[am::strings::msg_params] = 0;
+ (*event_message)[am::strings::params][am::hmi_response::code] =
+ mobile_result::SUCCESS;
+ event.set_smart_object(*event_message);
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>());
+
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::SUCCESS))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command->on_event(event);
+}
+
+} // namespace diagnostic_message_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc
new file mode 100644
index 0000000000..2f7415c98e
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/mobile/dial_number_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dial_number_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::DialNumberRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef SharedPtr<DialNumberRequest> DialNumberRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class DialNumberRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DialNumberRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_InvalidNumber_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "\t\n";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_EmptyNumber_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "NotANumber";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_DialNumber)));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) {
+ MessageSharedPtr 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;
+ (*event_msg)[am::strings::params][am::strings::info] = "test_info";
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+
+ command->on_event(event);
+}
+
+} // namespace dial_number_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc
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
new file mode 100644
index 0000000000..ceb5e3b916
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_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 <vector>
+
+#include "application_manager/commands/mobile/end_audio_pass_thru_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace end_audio_pass_thru_request {
+
+namespace am = ::application_manager;
+using ::testing::_;
+using ::testing::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_;
+};
+
+TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) {
+ const uint32_t kConnectionKey = 2u;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EndAudioPassThruRequestPtr command(
+ CreateCommand<EndAudioPassThruRequest>(command_msg));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params] = 0;
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::UNSUPPORTED_RESOURCE;
+
+ Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
+ event.set_smart_object(*event_msg);
+
+ 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;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+} // namespace end_audio_pass_thru_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc
new file mode 100644
index 0000000000..31d406d959
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/mobile/get_dtcs_request.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_dtcs_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::GetDTCsRequest;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+namespace mobile_result = mobile_apis::Result;
+
+typedef SharedPtr<GetDTCsRequest> GetDTCsRequestPtr;
+
+class GetDTCsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(GetDTCsRequestTest, Run_SUCCESS) {
+ const uint32_t kConnectionKey = 2u;
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::dtc_mask] = 0;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetDTCs)));
+
+ command->Run();
+}
+
+TEST_F(GetDTCsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) {
+ 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] =
+ mobile_apis::Result::SUCCESS;
+
+ Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
+ event.set_smart_object(*event_msg);
+ MockMessageHelper& mock_message_helper =
+ *MockMessageHelper::message_helper_mock();
+
+ ON_CALL(mock_message_helper, HMIToMobileResult(_))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+
+ command->on_event(event);
+}
+
+} // namespace get_dtcs_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
new file mode 100644
index 0000000000..a851a72f8e
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/mobile/get_vehicle_data_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_vehicle_data_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::GetVehicleDataRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef SharedPtr<GetVehicleDataRequest> GetVehicleDataRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class GetVehicleDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetVehicleDataRequestTest()
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock()) {
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ ~GetVehicleDataRequestTest() {
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ am::MockMessageHelper& mock_message_helper_;
+};
+
+class UnwrappedGetVehicleDataRequest : public GetVehicleDataRequest {
+ public:
+ UnwrappedGetVehicleDataRequest(const MessageSharedPtr& message,
+ am::ApplicationManager& application_manager)
+ : GetVehicleDataRequest(message, application_manager) {}
+
+ policy::RPCParams& get_disallowed_params() {
+ return removed_parameters_permissions_.disallowed_params;
+ }
+
+ using GetVehicleDataRequest::on_event;
+};
+
+#ifdef HMI_DBUS_API
+// HMI_DBUS_API currently not supported
+#else
+
+TEST_F(GetVehicleDataRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ GetVehicleDataRequestPtr command(CreateCommand<GetVehicleDataRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_TooHighFrequency_UNSUCCESS) {
+ const mobile_apis::FunctionID::eType kFunctionId =
+ mobile_apis::FunctionID::GetVehicleDataID;
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::function_id] = kFunctionId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ *app,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::CONFIG_FILE))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::REJECTED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_EmptyMsgParams_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ const am::VehicleData kEmptyVehicleData;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(kEmptyVehicleData));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest,
+ Run_EmptyMsgParamsAndHasDisallowedParams_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ SharedPtr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ const am::VehicleData kEmptyVehicleData;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(kEmptyVehicleData));
+
+ policy::RPCParams& disallowed_params = command->get_disallowed_params();
+ disallowed_params.insert("test_param");
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::DISALLOWED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_SUCCESS) {
+ const std::string kMsgParamKey("test_key");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(
+ am::VehicleData::value_type(kMsgParamKey, am::VehicleDataType::SPEED));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData)));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ SharedPtr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
+ const mobile_result::eType mobile_response_code =
+ mobile_result::VEHICLE_DATA_NOT_AVAILABLE;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ SharedPtr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::params][am::strings::error_msg] = "test_error";
+ (*event_msg)[am::strings::msg_params][am::hmi_response::method] = 0;
+
+ Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_response_code))
+ .WillOnce(Return(mobile_response_code));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command->on_event(event);
+}
+
+#endif // HMI_DBUS_API
+
+} // namespace get_vehicle_data_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc
new file mode 100644
index 0000000000..4b13576a39
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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::Mock;
+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;
+
+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()
+ : message_helper_mock_(*am::MockMessageHelper::message_helper_mock()) {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ }
+ ~GetWayPointsRequestTest() {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ }
+
+ 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_);
+ mock_app_ = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ }
+
+ MockMessageHelper& message_helper_mock_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+ utils::SharedPtr<application_manager::commands::GetWayPointsRequest>
+ command_sptr_;
+};
+
+class GetWayPointsRequestOnEventTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetWayPointsRequestOnEventTest()
+ : message_helper_mock_(*am::MockMessageHelper::message_helper_mock())
+ , app_(CreateMockApp()) {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ }
+ ~GetWayPointsRequestOnEventTest() {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ }
+
+ void CheckOnEventResponse(const std::string& wayPointsParam,
+ const MobileResult 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);
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event)));
+ EXPECT_EQ(
+ ResultCode,
+ static_cast<mobile_apis::Result::eType>(
+ (*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:
+ MockMessageHelper& message_helper_mock_;
+ 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_SendResponce) {
+ 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", SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case2) {
+ CheckOnEventResponse("", SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case3) {
+ CheckOnEventResponse("test", SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case1) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces_));
+ EXPECT_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::GENERIC_ERROR));
+ CheckOnEventResponse(" ", GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case2) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces_));
+ EXPECT_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::GENERIC_ERROR));
+ CheckOnEventResponse("test\t", GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case3) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces_));
+ EXPECT_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::GENERIC_ERROR));
+ CheckOnEventResponse("test\n", GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case4) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces_));
+ EXPECT_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::GENERIC_ERROR));
+ CheckOnEventResponse("test\t\n", 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
new file mode 100644
index 0000000000..85377054ef
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/list_files_request_test.cc
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/commands/mobile/list_files_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace list_files_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using am::commands::ListFilesRequest;
+using am::commands::MessageSharedPtr;
+
+class ListFilesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(SharedPtr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ const uint32_t kListFilesInNoneAllowed = 1u;
+ const uint32_t kListFilesInNoneCount = 2u;
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, list_files_in_none())
+ .WillByDefault(ReturnRef(kListFilesInNoneAllowed));
+ ON_CALL(*app, list_files_in_none_count())
+ .WillByDefault(Return(kListFilesInNoneCount));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ListFilesRequestTest, Run_SUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ ON_CALL(*app, increment_list_files_in_none_count()).WillByDefault(Return());
+
+ ON_CALL(*app, GetAvailableDiskSpace()).WillByDefault(Return(0));
+
+ am::AppFilesMap files_map;
+ ON_CALL(*app, getAppFiles()).WillByDefault(ReturnRef(files_map));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+} // namespace list_files_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc
new file mode 100644
index 0000000000..48f4497033
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc
@@ -0,0 +1,355 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+
+#include "application_manager/include/application_manager/commands/command_impl.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/commands/mobile/on_button_event_notification.h"
+#include "application_manager/commands/mobile/on_button_press_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_button_notification {
+
+namespace am = ::application_manager;
+namespace commands = am::commands;
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::Return;
+
+using ::utils::SharedPtr;
+using am::commands::MessageSharedPtr;
+
+namespace {
+const uint32_t kAppId = 5u;
+const uint32_t kCustomButtonId = 3u;
+const mobile_apis::ButtonName::eType kButtonName = mobile_apis::ButtonName::OK;
+} // namespace
+
+template <class NotificationT,
+ mobile_apis::FunctionID::eType kExpectedFunctionId>
+struct NotificationData {
+ typedef NotificationT Notification;
+ enum { kFunctionId = kExpectedFunctionId };
+};
+
+template <class NotificationDataT>
+class OnButtonNotificationCommandsTest
+ : public CommandsTest<CommandsTestMocks::kNotNice>,
+ public NotificationDataT {};
+
+typedef Types<NotificationData<commands::mobile::OnButtonEventNotification,
+ mobile_apis::FunctionID::OnButtonEventID>,
+ NotificationData<commands::mobile::OnButtonPressNotification,
+ mobile_apis::FunctionID::OnButtonPressID> >
+ OnButtonNotificationCommandsList;
+
+MATCHER_P(CheckNotificationMessage, function_id, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsFunctionIdCorrect =
+ (*arg)[am::strings::params][am::strings::function_id].asInt() ==
+ function_id;
+
+ bool is_custom_button_id_correct = true;
+ if ((*arg)[am::strings::msg_params].keyExists(
+ am::hmi_response::custom_button_id)) {
+ is_custom_button_id_correct =
+ (*arg)[am::strings::msg_params][am::strings::custom_button_id] ==
+ kCustomButtonId;
+ }
+
+ return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
+ kIsNotificationCorrect && kIsFunctionIdCorrect &&
+ is_custom_button_id_correct;
+}
+
+TYPED_TEST_CASE(OnButtonNotificationCommandsTest,
+ OnButtonNotificationCommandsList);
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_NoAppId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_NoCustomButtonId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_AppNotRegistered_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ EXPECT_CALL(this->app_mngr_, application(kAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_AppNotSubscribedToCustomButtonId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ ON_CALL(*mock_app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(this->app_mngr_,
+ SendMessageToMobile(
+ CheckNotificationMessage(TestFixture::kFunctionId), _));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_NoSubscribedApps_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ const std::vector<ApplicationSharedPtr> empty_subscribed_apps_list;
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(empty_subscribed_apps_list));
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_InvalidHmiLevel_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_ButtonOkOnlyForHmiLevelFull_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ SharedPtr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ ON_CALL(*mock_app, IsFullscreen()).WillByDefault(Return(true));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+
+ EXPECT_CALL(this->app_mngr_,
+ SendMessageToMobile(
+ CheckNotificationMessage(TestFixture::kFunctionId), _));
+
+ command->Run();
+}
+
+} // namespace on_button_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc
new file mode 100644
index 0000000000..def324bfb6
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_command_notification_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 <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/mobile/on_command_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_command_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using am::commands::OnCommandNotification;
+
+typedef ::utils::SharedPtr<OnCommandNotification> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCommandId = 5u;
+} // namespace
+
+class OnCommandNotificationTest
+ : public CommandsTest<CommandsTestMocks::kNotNice> {};
+
+TEST_F(OnCommandNotificationTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<OnCommandNotification>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnCommandNotificationTest, Run_NoAppsForTheCommand_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, FindCommand(kCommandId))
+ .WillOnce(Return(static_cast<SmartObject*>(NULL)));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ command->Run();
+}
+
+MATCHER(CheckNotificationMessage, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
+ kIsNotificationCorrect;
+}
+
+TEST_F(OnCommandNotificationTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ MessageSharedPtr dummy_msg(CreateMessage());
+ EXPECT_CALL(*mock_app, FindCommand(kCommandId))
+ .WillOnce(Return(dummy_msg.get()));
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckNotificationMessage(), _));
+
+ command->Run();
+}
+
+} // namespace on_command_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc
new file mode 100644
index 0000000000..9ef978d756
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_hash_change_notification_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 <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_hash_change_notification.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hash_change_notification {
+
+namespace strings = application_manager::strings;
+
+using application_manager::commands::mobile::OnHashChangeNotification;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::_;
+
+class OnHashChangeNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ 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_;
+};
+
+TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) {
+ const uint32_t kConnectionKey = 1u;
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ SharedPtr<OnHashChangeNotification> command =
+ CreateCommand<OnHashChangeNotification>(msg);
+
+ std::string return_string = "1234";
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, curHash()).WillOnce(ReturnRef(return_string));
+ EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ ASSERT_EQ(return_string,
+ (*msg)[strings::msg_params][strings::hash_id].asString());
+}
+
+TEST_F(OnHashChangeNotificationTest, Run_InvalidApp_NoNotification) {
+ const uint32_t kConnectionKey = 1u;
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ SharedPtr<OnHashChangeNotification> command =
+ CreateCommand<OnHashChangeNotification>(msg);
+
+ std::string return_string;
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app, curHash()).Times(0);
+ EXPECT_CALL(message_helper_, PrintSmartObject(_)).Times(0);
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+} // namespace on_hash_change_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
new file mode 100644
index 0000000000..2cfed4a26a
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
@@ -0,0 +1,280 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include <application_manager/smart_object_keys.h>
+#include "application_manager/message.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/mock_message_helper.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hmi_status_notification_from_mobile {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const connection_handler::DeviceHandle kHandle = 2u;
+} // namespace
+
+namespace strings = application_manager::strings;
+
+using application_manager::commands::OnHMIStatusNotificationFromMobile;
+using application_manager::ProtocolVersion;
+using application_manager::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::_;
+
+class OnHMIStatusNotificationFromMobileTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams(
+ const mobile_apis::HMILevel::eType kHMIState) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::hmi_level] = kHMIState;
+ return msg;
+ }
+ ApplicationSet app_set_;
+ sync_primitives::Lock lock_;
+};
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_CurrentStateForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(Return(ProtocolVersion::kV4));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app, set_foreground(true)).Times(0);
+
+ EXPECT_CALL(*mock_app, device()).Times(0);
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).Times(0);
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version()).Times(0);
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_CurrentStateNotForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(false));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(Return(ProtocolVersion::kV4));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_ProtocolVersionKV3_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(false));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(Return(ProtocolVersion::kV3));
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AppNotRequestedBeforeAndKV3_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(Return(ProtocolVersion::kV3));
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AppNotRequestedBefore_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(Return(ProtocolVersion::kV4));
+
+ 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, _));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ Mock::VerifyAndClearExpectations(&mock_message_helper);
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AnotherForegroundSDLApp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(Return(ProtocolVersion::kV4));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(false));
+
+ EXPECT_CALL(app_mngr_, MarkAppsGreyOut(kHandle, false));
+ EXPECT_CALL(app_mngr_, SendUpdateAppList());
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+} // namespace on_hmi_status_notification_from_mobile
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc
new file mode 100644
index 0000000000..8f2ce3d3dc
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_hmi_status_notification.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hmi_status_notification {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+} // namespace
+
+namespace strings = application_manager::strings;
+
+using application_manager::commands::OnHMIStatusNotification;
+using application_manager::ProtocolVersion;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using testing::Mock;
+using testing::Return;
+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();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::hmi_level] = kHMIState;
+ 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(app_mngr_, SendMessageToMobile(msg, _));
+ }
+
+ void VerifySendNotificationData(MessageSharedPtr& msg) {
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ }
+
+ MockMessageHelper& message_helper_;
+};
+
+TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ SharedPtr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).Times(0);
+ EXPECT_CALL(*mock_app, set_tts_properties_in_full(_)).Times(0);
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, AddAppToTTSGlobalPropertiesList(kConnectionKey))
+ .Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_InvalidEnum_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::INVALID_ENUM);
+
+ SharedPtr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_BackgroundAndFalseProperties_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
+ SetSendNotificationExpectations(msg);
+
+ SharedPtr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_none()).WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, set_tts_properties_in_none(true));
+ EXPECT_CALL(message_helper_, SendTTSGlobalProperties(_, false, _));
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_BackgroundAndTrueProperties_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ SharedPtr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_none()).WillOnce(Return(true));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_FullAndFalseProperties_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ SharedPtr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, set_tts_properties_in_full(true));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(app_mngr_, AddAppToTTSGlobalPropertiesList(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_FullAndTrueProperties_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ SharedPtr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).WillOnce(Return(true));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+} // namespace on_hmi_status_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc
new file mode 100644
index 0000000000..d56cd98904
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_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 "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_keyboard_input_notification.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include <application_manager/smart_object_keys.h>
+#include "application_manager/message.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_keyboard_input_notification {
+
+namespace strings = application_manager::strings;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+} // namespace
+
+using application_manager::commands::mobile::OnKeyBoardInputNotification;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using application_manager::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::_;
+
+class OnKeyBoardInputNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnKeyBoardInputNotificationTest()
+ : message_helper_(*MockMessageHelper::message_helper_mock()) {}
+
+ void SetSendNotificationExpectations(MessageSharedPtr msg) {
+ EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
+ }
+
+ void SetSendNotificationVariables(MessageSharedPtr msg) {
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ }
+
+ 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());
+ app_set->insert(app);
+ EXPECT_CALL(app_mngr_, applications())
+ .WillOnce(Return(DataAccessor<ApplicationSet>(*app_set, lock_)));
+ return app;
+ }
+
+ MockMessageHelper& message_helper_;
+ SharedPtr<ApplicationSet> app_set_;
+ sync_primitives::Lock lock_;
+};
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active()).WillOnce(Return(1));
+ EXPECT_CALL(*mock_app, perform_interaction_layout())
+ .WillOnce(Return(mobile_apis::LayoutMode::KEYBOARD));
+ EXPECT_CALL(*mock_app, hmi_level()).Times(0);
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ SetSendNotificationVariables(msg);
+
+ ASSERT_EQ(kConnectionKey,
+ (*msg)[strings::params][strings::connection_key].asInt());
+}
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active())
+ .WillRepeatedly(Return(0));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::eType::HMI_FULL));
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ SetSendNotificationVariables(msg);
+
+ ASSERT_EQ(kConnectionKey,
+ (*msg)[strings::params][strings::connection_key].asInt());
+}
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active())
+ .WillRepeatedly(Return(0));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::eType::HMI_BACKGROUND));
+
+ EXPECT_CALL(message_helper_, PrintSmartObject(_)).Times(0);
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+}
+
+} // namespace on_keyboard_input_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
new file mode 100644
index 0000000000..43f725012d
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_system_request_notification.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_system_request_notification {
+
+namespace strings = application_manager::strings;
+
+using application_manager::commands::mobile::OnSystemRequestNotification;
+using application_manager::commands::CommandImpl;
+using application_manager::MockMessageHelper;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using namespace mobile_apis;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::_;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+} // namespace
+
+class OnSystemRequestNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ 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_;
+};
+
+TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
+ const RequestType::eType kRequestType = RequestType::PROPRIETARY;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = kRequestType;
+
+ SharedPtr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ MockPolicyHandlerInterface mock_policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillRepeatedly(ReturnRef(mock_policy_handler));
+ std::string policy_app_id;
+ EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
+ EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
+ .WillOnce(Return(true));
+
+#ifdef PROPRIETARY_MODE
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .Times(2)
+ .WillRepeatedly(ReturnRef(mock_policy_handler));
+ EXPECT_CALL(mock_policy_handler, TimeoutExchangeSec()).WillOnce(Return(5u));
+#endif // PROPRIETARY_MODE
+
+ EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(FileType::JSON,
+ (*msg)[strings::msg_params][strings::file_type].asInt());
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
+ const RequestType::eType kRequestType = RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = kRequestType;
+
+ SharedPtr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ MockPolicyHandlerInterface mock_policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler));
+ std::string policy_app_id;
+ EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
+ EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(FileType::BINARY,
+ (*msg)[strings::msg_params][strings::file_type].asInt());
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
+ const RequestType::eType kRequestType = RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = kRequestType;
+
+ SharedPtr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
+ EXPECT_CALL(*mock_app, policy_app_id()).Times(0);
+ MockPolicyHandlerInterface mock_policy_handler;
+ EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _)).Times(0);
+
+ EXPECT_CALL(message_helper_, PrintSmartObject(_)).Times(0);
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) {
+ const RequestType::eType kRequestType = RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = kRequestType;
+
+ SharedPtr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ MockPolicyHandlerInterface mock_policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler));
+ std::string policy_app_id;
+ EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
+ EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(message_helper_, PrintSmartObject(_)).Times(0);
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
+ ;
+
+ command->Run();
+}
+
+} // namespace on_system_request_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc
new file mode 100644
index 0000000000..59cddc325f
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_tbt_client_state_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using am::commands::OnTBTClientStateNotification;
+
+typedef ::utils::SharedPtr<OnTBTClientStateNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnTBTClientStateNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnTBTClientStateNotificationTest()
+ : command_(CreateCommand<OnTBTClientStateNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+TEST_F(OnTBTClientStateNotificationTest, Run_HmiLevelNone_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command_->Run();
+}
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnTBTClientStateNotificationTest,
+ Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
+
+ command_->Run();
+}
+
+} // namespace on_tbt_client_state_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
new file mode 100644
index 0000000000..466facec1f
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_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 <vector>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_touch_event_notification.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_touch_event_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using am::commands::mobile::OnTouchEventNotification;
+
+typedef ::utils::SharedPtr<OnTouchEventNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnTouchEventNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnTouchEventNotificationTest()
+ : command_(CreateCommand<OnTouchEventNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+TEST_F(OnTouchEventNotificationTest, Run_AppIsNotFullscreen_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(_, _)).Times(0);
+
+ command_->Run();
+}
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnTouchEventNotificationTest, Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillOnce(Return(true));
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
+
+ command_->Run();
+}
+
+} // namespace on_touch_event_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
new file mode 100644
index 0000000000..d00e62bcfb
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <vector>
+#include <map>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
+#include "utils/shared_ptr.h"
+#include "utils/custom_string.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_vehicle_data_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+using am::commands::MessageSharedPtr;
+using am::commands::OnVehicleDataNotification;
+
+typedef ::utils::SharedPtr<OnVehicleDataNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnVehicleDataNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnVehicleDataNotificationTest()
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
+ , command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<OnVehicleDataNotification>(command_msg_)) {}
+
+ am::MockMessageHelper& mock_message_helper_;
+ MessageSharedPtr command_msg_;
+ NotificationPtr command_;
+};
+
+MATCHER_P2(CheckMessageData, key, value, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ const bool kAreMsgParamsCorrect =
+ (*arg)[am::strings::msg_params][key].asInt() == value;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect,
+ kAreMsgParamsCorrect);
+}
+
+TEST_F(OnVehicleDataNotificationTest,
+ Run_NotEmptyListOfAppsSubscribedForEvent_SUCCESS) {
+ am::VehicleData test_vehicle_data;
+ test_vehicle_data.insert(am::VehicleData::value_type(
+ am::strings::fuel_level, am::VehicleDataType::FUELLEVEL));
+
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(test_vehicle_data));
+
+ const int kFuelLevel = 100;
+ (*command_msg_)[am::strings::msg_params][am::strings::fuel_level] =
+ kFuelLevel;
+
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications;
+ applications.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_,
+ IviInfoUpdated(am::VehicleDataType::FUELLEVEL, kFuelLevel))
+ .WillOnce(Return(applications));
+
+ EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
+ ::utils::custom_string::CustomString dummy_name("test_app");
+ ON_CALL(*mock_app, name()).WillByDefault(ReturnRef(dummy_name));
+
+ EXPECT_CALL(app_mngr_,
+ SendMessageToMobile(
+ CheckMessageData(am::strings::fuel_level, kFuelLevel), _));
+
+ command_->Run();
+}
+
+} // namespace on_vehicle_data_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc
new file mode 100644
index 0000000000..b0dd3c142c
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_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 <set>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/on_way_point_change_notification.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_way_point_change_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using am::commands::OnWayPointChangeNotification;
+
+typedef ::utils::SharedPtr<OnWayPointChangeNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnWayPointChangeNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnWayPointChangeNotificationTest()
+ : command_(CreateCommand<OnWayPointChangeNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnWayPointChangeNotificationTest,
+ Run_NotEmptyListOfAppsSubscribedForWayPoints_SUCCESS) {
+ std::set<int32_t> apps_subscribed_for_way_points;
+ apps_subscribed_for_way_points.insert(kAppId);
+
+ EXPECT_CALL(app_mngr_, GetAppsSubscribedForWayPoints())
+ .WillOnce(Return(apps_subscribed_for_way_points));
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
+
+ command_->Run();
+}
+
+} // namespace on_way_point_change_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
new file mode 100644
index 0000000000..9126e43050
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
@@ -0,0 +1,788 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace perform_audio_pass_thru_request {
+
+namespace am = application_manager;
+using am::commands::PerformAudioPassThruRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using 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())
+ , message_(utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map))
+ , msg_params_((*message_)[am::strings::msg_params]) {}
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void TestWrongSyntaxInField(const std::string& field) {
+ if (field == am::strings::initial_prompt) {
+ msg_params_[field][0][am::strings::text] = "prompt\\n";
+ } else {
+ msg_params_[field] = "prompt\\n";
+ }
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(am::mobile_api::Result::INVALID_DATA, result);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(hmi_interfaces_));
+ command_sptr_ =
+ CreateCommand<am::commands::PerformAudioPassThruRequest>(message_);
+
+ application_sptr_ = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(application_sptr_));
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ 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) {
+ MessageSharedPtr msg_ui = CreateMessage(smart_objects::SmartType_Map);
+ (*msg_ui)[am::strings::msg_params][am::strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*msg_ui)[am::strings::msg_params][am::strings::success] = false;
+
+ utils::SharedPtr<PerformAudioPassThruRequest> command =
+ CreateCommand<PerformAudioPassThruRequest>();
+
+ EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(msg_ui));
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ command->onTimeOut();
+ EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+ 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 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";
+
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ event.set_smart_object(*msg);
+
+ 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_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_msg_tts =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_tts)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response_msg_tts)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_msg_tts);
+ ON_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::SUCCESS))
+ .WillByDefault(Return(am::mobile_api::Result::SUCCESS));
+ command->on_event(event_tts);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(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(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_StopSpeaking))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_OnRecordStart))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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_);
+
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::REJECTED))
+ .WillOnce(Return(am::mobile_api::Result::REJECTED));
+
+ CallOnEvent caller(*command_sptr_, event);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result_code =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(am::mobile_api::Result::REJECTED, result_code);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ OnEvent_TTSSpeakSuccess_UpdateRequestTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ // Start recording notification sending
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ // Start microphone recording cals
+ EXPECT_CALL(app_mngr_, BeginAudioPassThrough());
+ EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+
+ ON_CALL(hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillOnce(Return(am::mobile_api::Result::SUCCESS));
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ 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(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(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(hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillByDefault(Return(am::mobile_api::Result::SUCCESS));
+ 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(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(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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));
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillOnce(Return(am::mobile_api::Result::SUCCESS));
+
+ 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
new file mode 100644
index 0000000000..22ce735c61
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/perform_interaction_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "utils/helpers.h"
+#include "utils/make_shared.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace perform_interaction_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using ::testing::_;
+using ::testing::Mock;
+using ::utils::SharedPtr;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using am::commands::PerformInteractionRequest;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class PerformInteractionRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ PerformInteractionRequestTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock())
+ , 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,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ MockMessageHelper& mock_message_helper_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
+ MessageSharedPtr response_msg_vr =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_vr)[strings::params][hmi_response::code] =
+ static_cast<uint64_t>(hmi_apis::Common_Result::SUCCESS);
+ (*response_msg_vr)[strings::msg_params][strings::info] = "info";
+ MessageSharedPtr request_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*request_msg)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::BOTH;
+ utils::SharedPtr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(request_msg);
+ MockAppPtr mock_app;
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ Event event(hmi_apis::FunctionID::VR_PerformInteraction);
+ event.set_smart_object(*response_msg_vr);
+
+ command->Init();
+ command->on_event(event);
+ MessageSharedPtr response_to_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_to_mobile)[strings::msg_params][strings::result_code] =
+ static_cast<uint64_t>(am::mobile_api::Result::GENERIC_ERROR);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(response_to_mobile));
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+ command->onTimeOut();
+
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(PerformInteractionRequestTest,
+ OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::VR_ONLY;
+ utils::SharedPtr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ command->Init();
+
+ MockAppPtr mock_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app));
+
+ 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] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_msg_vr)[strings::msg_params][strings::cmd_id] = kCommandId;
+ (*response_msg_vr)[am::strings::msg_params][am::strings::info] =
+ "VR is not supported by system";
+
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
+ event_vr.set_smart_object(*response_msg_vr);
+
+ MessageSharedPtr response_msg_ui =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
+ event_ui.set_smart_object(*response_msg_ui);
+
+ EXPECT_CALL(hmi_interfaces,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(hmi_interfaces,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "VR is not supported by system");
+}
+
+TEST_F(PerformInteractionRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::VR_ONLY;
+ utils::SharedPtr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+
+ ON_CALL(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));
+
+ MessageSharedPtr response_msg_vr =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
+ event_vr.set_smart_object(*response_msg_vr);
+
+ MessageSharedPtr response_msg_ui =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_msg_ui)[strings::msg_params][strings::cmd_id] = kCommandId;
+ (*response_msg_ui)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
+ event_ui.set_smart_object(*response_msg_ui);
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+
+ EXPECT_CALL(*mock_app_, is_perform_interaction_active())
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app_, DeletePerformInteractionChoiceSet(_));
+
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "UI is not supported by system");
+}
+
+} // namespace perform_interaction_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/put_file_test.cc b/src/components/application_manager/test/commands/mobile/put_file_test.cc
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
new file mode 100644
index 0000000000..334f559ae6
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/mobile/read_did_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace read_did_request {
+
+using ::testing::_;
+using ::testing::DoAll;
+using ::testing::Return;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using am::commands::ReadDIDRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using ::utils::SharedPtr;
+
+class ReadDIDRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) {
+ Event event(Event::EventID::VehicleInfo_ReadDID);
+
+ SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ const mobile_apis::Result::eType mobile_response_code =
+ mobile_apis::Result::SUCCESS;
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ event.set_smart_object(*event_msg);
+
+ am::MockMessageHelper& mock_message_helper(
+ *am::MockMessageHelper::message_helper_mock());
+ EXPECT_CALL(mock_message_helper, HMIToMobileResult(hmi_response_code))
+ .WillOnce(Return(mobile_response_code));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command->on_event(event);
+
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper);
+}
+
+TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(SharedPtr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_CommandLimitsExceeded_UNSUCCESS) {
+ SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(true));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_EmptyDidLocation_UNSUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_SUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::msg_params][am::strings::did_location]["SomeData"] = 0;
+ SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>(msg));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
+ EXPECT_EQ(hmi_apis::FunctionID::VehicleInfo_ReadDID,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+}
+
+} // namespace read_did_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc
new file mode 100644
index 0000000000..96b3cb067b
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc
@@ -0,0 +1,366 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "mobile/register_app_interface_request.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "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/custom_string.h"
+#include "utils/lock.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace register_app_interface_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+
+namespace am = ::application_manager;
+
+using ::utils::SharedPtr;
+using am::commands::MessageSharedPtr;
+using am::commands::RegisterAppInterfaceRequest;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const hmi_apis::Common_Language::eType kHmiLanguage =
+ hmi_apis::Common_Language::EN_US;
+const mobile_apis::Language::eType kMobileLanguage =
+ mobile_apis::Language::EN_US;
+const std::string kMacAddress = "test_mac_address";
+const std::string kAppId = "test_app_id";
+const std::string kDummyString = "test_string";
+const std::vector<uint32_t> kDummyDiagModes;
+} // namespace
+
+class RegisterAppInterfaceRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RegisterAppInterfaceRequestTest()
+ : msg_(CreateMessage())
+ , command_(CreateCommand<RegisterAppInterfaceRequest>(msg_))
+ , app_name_("test_app_name_") {
+ InitGetters();
+ InitLanguage();
+ }
+
+ void InitBasicMessage() {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*msg_)[am::strings::msg_params][am::strings::app_name] = app_name_;
+ (*msg_)[am::strings::msg_params][am::strings::language_desired] =
+ kHmiLanguage;
+ (*msg_)[am::strings::msg_params]
+ [am::strings::hmi_display_language_desired] = kHmiLanguage;
+ }
+
+ MockAppPtr CreateBasicMockedApp() {
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(*mock_app, name()).WillByDefault(ReturnRef(app_name_));
+ ON_CALL(*mock_app, mac_address()).WillByDefault(ReturnRef(kMacAddress));
+ ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(*mock_app, language()).WillByDefault(ReturnRef(kMobileLanguage));
+ ON_CALL(*mock_app, ui_language()).WillByDefault(ReturnRef(kMobileLanguage));
+ return mock_app;
+ }
+
+ void InitLanguage(
+ hmi_apis::Common_Language::eType ui_language = kHmiLanguage,
+ hmi_apis::Common_Language::eType vr_language = kHmiLanguage,
+ hmi_apis::Common_Language::eType tts_language = kHmiLanguage) {
+ ON_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillByDefault(Return(vr_language));
+ ON_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillByDefault(Return(ui_language));
+ ON_CALL(mock_hmi_capabilities_, active_tts_language())
+ .WillByDefault(Return(tts_language));
+ }
+
+ void InitGetters() {
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(true));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(app_mngr_, resume_controller())
+ .WillByDefault(ReturnRef(mock_resume_crt_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(mock_hmi_capabilities_));
+ ON_CALL(app_mngr_settings_, sdl_version())
+ .WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(mock_hmi_capabilities_, ccpu_version())
+ .WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(app_mngr_settings_, supported_diag_modes())
+ .WillByDefault(ReturnRef(kDummyDiagModes));
+ ON_CALL(mock_policy_handler_, GetAppRequestTypes(_))
+ .WillByDefault(Return(std::vector<std::string>()));
+ ON_CALL(mock_policy_handler_, GetUserConsentForDevice(_))
+ .WillByDefault(Return(policy::DeviceConsent::kDeviceAllowed));
+ ON_CALL(app_mngr_, GetDeviceTransportType(_))
+ .WillByDefault(Return(hmi_apis::Common_TransportType::WIFI));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ }
+
+ MessageSharedPtr msg_;
+ SharedPtr<RegisterAppInterfaceRequest> command_;
+
+ const utils::custom_string::CustomString app_name_;
+ sync_primitives::Lock lock_;
+ am::ApplicationSet app_set_;
+
+ typedef IsNiceMock<policy_test::MockPolicyHandlerInterface,
+ kMocksAreNice>::Result MockPolicyHandlerInterface;
+
+ typedef IsNiceMock<resumprion_test::MockResumeCtrl, kMocksAreNice>::Result
+ MockResumeCtrl;
+
+ typedef IsNiceMock<connection_handler_test::MockConnectionHandler,
+ kMocksAreNice>::Result MockConnectionHandler;
+
+ typedef IsNiceMock<protocol_handler_test::MockSessionObserver,
+ kMocksAreNice>::Result MockSessionObserver;
+
+ typedef IsNiceMock<application_manager_test::MockHMICapabilities,
+ kMocksAreNice>::Result MockHMICapabilities;
+
+ 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_;
+};
+
+TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) {
+ EXPECT_TRUE(command_->Init());
+}
+
+TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
+ InitBasicMessage();
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId;
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()))
+ .WillRepeatedly(Return(mock_app));
+
+ ON_CALL(app_mngr_, applications())
+ .WillByDefault(Return(DataAccessor<am::ApplicationSet>(app_set_, lock_)));
+ ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
+ .WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ utils::MakeShared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ .WillByDefault(Return(notify_upd_manager));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
+ .Times(2);
+ command_->Run();
+}
+
+MATCHER_P(CheckHMIInterfacesRealtedData, expected_data, "") {
+ const bool is_result_id_correct =
+ mobile_apis::Result::SUCCESS ==
+ static_cast<mobile_apis::Result::eType>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+
+ const bool are_ui_related_data_exist =
+ (*arg)[am::strings::msg_params].keyExists(
+ am::hmi_response::display_capabilities);
+
+ const bool are_vi_related_data_exist =
+ (*arg)[am::strings::msg_params][am::hmi_response::vehicle_type] ==
+ (*expected_data)[am::hmi_response::vehicle_type];
+
+ const bool are_vr_related_data_exist =
+ (*arg)[am::strings::msg_params][am::strings::vr_capabilities] ==
+ (*expected_data)[am::strings::vr_capabilities];
+
+ return is_result_id_correct && are_ui_related_data_exist &&
+ are_vi_related_data_exist && are_vr_related_data_exist;
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ Run_HmiInterfacesStateAvailable_SUCCESS) {
+ InitBasicMessage();
+
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()))
+ .WillRepeatedly(Return(mock_app));
+
+ MessageSharedPtr expected_message =
+ CreateMessage(smart_objects::SmartType_Map);
+
+ (*expected_message)[am::hmi_response::vehicle_type] = "test_vehicle_type";
+ (*expected_message)[am::strings::vr_capabilities] = "test_vr_capabilities";
+ (*expected_message)[am::hmi_response::display_capabilities] = 0;
+ SmartObject& display_capabilities =
+ (*expected_message)[am::hmi_response::display_capabilities];
+ display_capabilities[am::hmi_response::display_type] = "test_display_type";
+ display_capabilities[am::hmi_response::text_fields] = "test_text_fields";
+ display_capabilities[am::hmi_response::image_fields] = "test_image_fields";
+ display_capabilities[am::hmi_response::media_clock_formats] =
+ "test_media_clock_formats";
+ display_capabilities[am::hmi_response::num_custom_presets_available] =
+ "test_num_custom_presets_available";
+ display_capabilities[am::hmi_response::graphic_supported] =
+ "test_graphic_supported";
+ display_capabilities[am::hmi_response::templates_available] =
+ "test_templates_available";
+ display_capabilities[am::hmi_response::screen_params] = "test_screen_params";
+
+ ON_CALL(mock_hmi_capabilities_, vehicle_type())
+ .WillByDefault(
+ Return(&(*expected_message)[am::hmi_response::vehicle_type]));
+ ON_CALL(mock_hmi_capabilities_, vr_capabilities())
+ .WillByDefault(
+ Return(&(*expected_message)[am::strings::vr_capabilities]));
+ ON_CALL(mock_hmi_capabilities_, display_capabilities())
+ .WillByDefault(
+ Return(&(*expected_message)[am::hmi_response::display_capabilities]));
+
+ ON_CALL(app_mngr_, applications())
+ .WillByDefault(Return(DataAccessor<am::ApplicationSet>(app_set_, lock_)));
+ ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
+ .WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ utils::MakeShared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ .WillByDefault(Return(notify_upd_manager));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
+ .Times(2);
+
+ command_->Run();
+}
+
+} // namespace register_app_interface_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc
new file mode 100644
index 0000000000..29c52bb0d5
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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::Mock;
+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()
+ : mock_message_helper_(am::MockMessageHelper::message_helper_mock())
+ , msg_(CreateMessage())
+ , mock_app_(CreateMockApp()) {
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
+ }
+
+ 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));
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
+ }
+ am::MockMessageHelper* mock_message_helper_;
+ 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;
+ ON_CALL(*mock_message_helper_, HMIToMobileResult(result_code))
+ .WillByDefault(Return(am::mobile_api::Result::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));
+
+ command_->Run();
+
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::ORIGIN_SDL));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ 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));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ 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_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ (*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));
+
+ command_->Run();
+
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::ORIGIN_SDL));
+
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ command_->on_event(event);
+}
+
+} // 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
new file mode 100644
index 0000000000..aba549eb34
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc
@@ -0,0 +1,319 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/scrollable_message_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace scrollable_message_request {
+
+namespace am = application_manager;
+namespace hmi_response = am::hmi_response;
+namespace mobile_result = mobile_apis::Result;
+namespace am = ::application_manager;
+
+using am::commands::ScrollableMessageRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using ::utils::SharedPtr;
+using ::testing::_;
+using ::testing::Eq;
+using ::testing::Ref;
+using ::testing::Mock;
+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
+ MockHMICapabilities;
+ sync_primitives::Lock lock_;
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ command_ = CreateCommand<ScrollableMessageRequest>(msg_);
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ MockPolicyHandlerInterface mock_policy_handler_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ SharedPtr<ScrollableMessageRequest> command_;
+};
+
+typedef ScrollableMessageRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ utils::SharedPtr<ScrollableMessageRequest> command =
+ CreateCommand<ScrollableMessageRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ 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())
+ .WillByDefault(ReturnRef(hmi_capabilities));
+ ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(true));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info1";
+
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg);
+
+ 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->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+ 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(mock_message_helper_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::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(mock_message_helper_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
+
+ MockHmiInterfaces hmi_interfaces;
+ ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
+ EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ 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_location_request_test.cc b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc
new file mode 100644
index 0000000000..df412695fd
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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;
+using ::testing::Mock;
+
+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_message_helper_(*MockMessageHelper::message_helper_mock()) {
+ mock_app_ = CreateMockApp();
+ disp_cap_ = utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ message_ = CreateMessage();
+ command_ = CreateCommand<UnwrappedSendLocationRequest>(message_);
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ 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_;
+ MockMessageHelper& mock_message_helper_;
+ 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;
+ Event event(hmi_apis::FunctionID::Navigation_SendLocation);
+ event.set_smart_object(*message_);
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::SUCCESS))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ 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
new file mode 100644
index 0000000000..b51b7c83ea
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/set_app_icon_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_app_icon_request {
+
+namespace am = application_manager;
+using am::commands::SetAppIconRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using ::utils::SharedPtr;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class SetAppIconRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ 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;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+};
+
+TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ const std::string file_path = "file_path";
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_vr)[am::strings::msg_params][am::strings::sync_file_name]
+ [am::strings::value] = file_path;
+
+ const std::string dir_path = "./";
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(dir_path));
+
+ utils::SharedPtr<SetAppIconRequest> req_vr =
+ CreateCommand<SetAppIconRequest>(msg_vr);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, set_app_icon_path(_)).WillByDefault(Return(true));
+ ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(file_path));
+
+ 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;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info1";
+
+ 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_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ req_vr->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+ 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
new file mode 100644
index 0000000000..0518b325ea
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc
@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/set_display_layout_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_display_layout_request {
+
+namespace am = application_manager;
+namespace mobile_result = mobile_apis::Result;
+using am::commands::SetDisplayLayoutRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using 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()) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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_));
+ }
+
+ ~SetDisplayLayoutRequestTest() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ MockMessageHelper& mock_message_helper_;
+ MockAppPtr mock_app_;
+};
+
+typedef SetDisplayLayoutRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(SetDisplayLayoutRequestTest,
+ OnEvent_UIHmiUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ utils::SharedPtr<SetDisplayLayoutRequest> command =
+ CreateCommand<SetDisplayLayoutRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ event.set_smart_object(*msg);
+
+ ON_CALL(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_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetDisplayLayoutRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ MockAppPtr invalid_mock_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_mock_app));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+
+ command->Run();
+}
+
+TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationKey));
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ 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) {
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>());
+
+ 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;
+ 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));
+
+ 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
new file mode 100644
index 0000000000..0908b54ba7
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc
@@ -0,0 +1,1254 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/set_global_properties_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_global_properties_request {
+
+namespace am = application_manager;
+using am::commands::SetGlobalPropertiesRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using am::CommandsMap;
+using utils::custom_string::CustomString;
+using ::utils::SharedPtr;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 1u;
+const std::string kText = "one";
+const uint32_t kPosition = 1u;
+} // namespace
+
+class SetGlobalPropertiesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetGlobalPropertiesRequestTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock())
+ , mock_app_(CreateMockApp()) {}
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ msg_params[am::strings::vr_help_title] = "vr_help_title";
+ msg_params[am::strings::vr_help][0][am::strings::text] = "vr_help";
+ msg_params[am::strings::vr_help][0][am::strings::position] = 1u;
+ msg_params[am::strings::help_prompt][0][am::strings::text] = "help_promt";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+ }
+
+ void VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array) {
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ }
+
+ void OnEventUISetupHelper(MessageSharedPtr msg,
+ SharedPtr<SetGlobalPropertiesRequest> command) {
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ EXPECT_CALL(mock_message_helper_,
+ VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_,
+ RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ command->Run();
+ }
+
+ void OnEventTTSSetupHelper(MessageSharedPtr msg,
+ SharedPtr<SetGlobalPropertiesRequest> command) {
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] =
+ timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_,
+ RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title("title");
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ command->Run();
+ }
+
+ void EmptyExpectationsSetupHelper() {
+ EXPECT_CALL(*mock_app_, set_vr_help_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_vr_help(_)).Times(0);
+ EXPECT_CALL(*mock_app_, vr_help_title()).Times(0);
+ EXPECT_CALL(*mock_app_, vr_help()).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ }
+
+ void ExpectInvalidData() {
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA),
+ am::commands::Command::ORIGIN_SDL));
+ }
+
+ void ExpectVerifyImageVrHelpSuccess(SmartObject& smart_obj) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(smart_obj, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void ExpectVerifyImageVrHelpUnsuccess() {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void ExpectVerifyImageSuccess(SmartObject& smart_obj) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(smart_obj, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(hmi_interfaces_));
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void ExpectationsHmiInterface_Run() {
+ EXPECT_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ 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_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ }
+ sync_primitives::Lock lock_;
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ MockMessageHelper& mock_message_helper_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::msg_params][am::strings::vr_commands][0] =
+ "vr_command";
+
+ utils::SharedPtr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(msg_vr);
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ const smart_objects::SmartObject* vr_help_title =
+ &((*msg_vr)[am::strings::msg_params][am::strings::vr_help_title]);
+ const smart_objects::SmartObject* vr_help =
+ &((*msg_vr)[am::strings::msg_params][am::strings::vr_help]);
+ const smart_objects::SmartObject* vr_help_prompt =
+ &((*msg_vr)[am::strings::msg_params][am::strings::help_prompt]);
+ ON_CALL(*mock_app_, vr_help_title()).WillByDefault(Return(vr_help_title));
+ ON_CALL(*mock_app_, vr_help()).WillByDefault(Return(vr_help));
+ ON_CALL(*mock_app_, help_prompt()).WillByDefault(Return(vr_help_prompt));
+
+ ExpectationsHmiInterface_Run();
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ ON_CALL(mock_message_helper_,
+ VerifyImageVrHelpItems(
+ (*msg_vr)[am::strings::msg_params][am::strings::vr_help], _, _))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+
+ ON_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+
+ 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);
+ event_vr.set_smart_object(*msg_vr);
+
+ command->Run();
+ command->on_event(event_vr);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response)[am::strings::msg_params][am::strings::info] = "test";
+
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*response);
+
+ utils::SharedPtr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(response);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .Times(0);
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_Expect_false) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response)[am::strings::msg_params][am::strings::info] = "qwe";
+
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event_tts.set_smart_object(*response);
+ am::event_engine::Event event_ui(
+ hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event_tts.set_smart_object(*response);
+ utils::SharedPtr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(response);
+
+ 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(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->Run();
+ command->on_event(event_ui);
+ command->on_event(event_tts);
+
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::INVALID_DATA));
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ EXPECT_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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));
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)).Times(0);
+
+ 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;
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ ON_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ OnEventUISetupHelper(msg, command);
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ EXPECT_CALL(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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ OnEventUISetupHelper(msg, command);
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)).Times(0);
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ 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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(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(mock_message_helper_, HMIToMobileResult(_)).Times(0);
+ 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(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(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(mock_message_helper_, HMIToMobileResult(response_code))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ 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();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(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(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(mock_message_helper_, HMIToMobileResult(_))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+} // 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
new file mode 100644
index 0000000000..da6f29cf5e
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc
@@ -0,0 +1,367 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_media_clock_timer_request {
+
+namespace am = ::application_manager;
+using am::commands::SetMediaClockRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::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()) {}
+
+ 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,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ return msg;
+ }
+
+ void ExpectationsSetupHelper(bool is_media) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(is_media));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ }
+
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ MockMessageHelper& mock_message_helper_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SetMediaClockRequestTest,
+ OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ utils::SharedPtr<SetMediaClockRequest> command =
+ CreateCommand<SetMediaClockRequest>(msg);
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*ev_msg);
+
+ EXPECT_CALL(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_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTUP;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
+ kSeconds;
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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(hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(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] =
+ mobile_apis::Result::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Null);
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+
+ Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetMediaClockRequestTest, OnEvent_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+} // namespace set_media_clock_timer_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc
new file mode 100644
index 0000000000..2d2e19cbf2
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/show_test.cc
@@ -0,0 +1,812 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/show_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace show_request {
+
+namespace am = application_manager;
+using am::commands::ShowRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using ::utils::SharedPtr;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kFunctionID = 3u;
+} // namespace
+
+class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ShowRequestTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {
+ mock_app_ = CreateMockApp();
+ }
+ sync_primitives::Lock lock_;
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ return msg;
+ }
+
+ void TestSetupHelper(MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ msg_params[field] = text_field_;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params.erase(field);
+ msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_name] =
+ static_cast<int32_t>(field_name);
+ msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_text] =
+ text_field_;
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+ }
+
+ void TestSetupHelperWrongSyntax(
+ MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ msg_params[field] = text_field_;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+ }
+
+ void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ MockAppPtr mock_app_;
+ MockMessageHelper& mock_message_helper_;
+ std::string text_field_;
+};
+
+TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = 10u;
+ (*msg_vr)[am::strings::msg_params][am::strings::menu_params]
+ [am::strings::menu_name] = "menu_name";
+
+ utils::SharedPtr<ShowRequest> command = CreateCommand<ShowRequest>(msg_vr);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ 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] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ 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_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*vr_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*vr_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*vr_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_Canceled) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ 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();
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+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_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] =
+ mobile_apis::Result::SUCCESS;
+ (*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);
+
+ 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);
+
+ 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
new file mode 100644
index 0000000000..cbc2d702b3
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_message_helper.h"
+#include "command_impl.h"
+#include "commands/commands_test.h"
+#include "mobile/on_app_interface_unregistered_notification.h"
+#include "mobile/on_audio_pass_thru_notification.h"
+#include "mobile/on_driver_distraction_notification.h"
+#include "mobile/on_language_change_notification.h"
+#include "mobile/on_permissions_change_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace simple_notification_commands_test {
+
+namespace am = ::application_manager;
+namespace commands = am::commands;
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::Return;
+using ::testing::Mock;
+
+using am::MockMessageHelper;
+
+template <class Command>
+class MobileNotificationCommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ public:
+ MobileNotificationCommandsTest()
+ : message_helper_(*MockMessageHelper::message_helper_mock()) {
+ Mock::VerifyAndClearExpectations(&message_helper_);
+ }
+
+ ~MobileNotificationCommandsTest() {
+ Mock::VerifyAndClearExpectations(&message_helper_);
+ }
+
+ protected:
+ MockMessageHelper& message_helper_;
+};
+
+typedef Types<commands::OnAppInterfaceUnregisteredNotification,
+ commands::OnAudioPassThruNotification,
+ commands::OnLanguageChangeNotification,
+ commands::OnPermissionsChangeNotification,
+ commands::mobile::OnDriverDistractionNotification>
+ NotificationCommandsList;
+
+MATCHER(CheckNotificationMessage, "") {
+ return (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ commands::CommandImpl::mobile_protocol_type_ &&
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ commands::CommandImpl::protocol_version_ &&
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ application_manager::MessageType::kNotification;
+}
+
+TYPED_TEST_CASE(MobileNotificationCommandsTest, NotificationCommandsList);
+
+TYPED_TEST(MobileNotificationCommandsTest, Run_SendMessageToMobile_SUCCESS) {
+ ::utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_CALL(this->app_mngr_,
+ SendMessageToMobile(CheckNotificationMessage(), _));
+ command->Run();
+}
+
+} // namespace simple_notification_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc
new file mode 100644
index 0000000000..d80a7e0551
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc
@@ -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.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+#include "utils/shared_ptr.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "mobile/read_did_response.h"
+#include "mobile/delete_command_response.h"
+#include "mobile/alert_maneuver_response.h"
+#include "mobile/alert_response.h"
+#include "mobile/list_files_response.h"
+#include "mobile/subscribe_button_response.h"
+#include "mobile/add_sub_menu_response.h"
+#include "mobile/diagnostic_message_response.h"
+#include "mobile/dial_number_response.h"
+#include "mobile/end_audio_pass_thru_response.h"
+#include "mobile/get_dtcs_response.h"
+#include "mobile/get_vehicle_data_response.h"
+#include "mobile/unregister_app_interface_response.h"
+#include "mobile/unsubscribe_button_response.h"
+#include "mobile/unsubscribe_way_points_response.h"
+#include "mobile/update_turn_list_response.h"
+#include "mobile/slider_response.h"
+#include "mobile/speak_response.h"
+#include "mobile/subscribe_vehicle_data_response.h"
+#include "mobile/subscribe_way_points_response.h"
+#include "mobile/system_response.h"
+#include "mobile/get_way_points_response.h"
+#include "mobile/perform_interaction_response.h"
+#include "mobile/perform_audio_pass_thru_response.h"
+#include "mobile/set_global_properties_response.h"
+#include "mobile/set_media_clock_timer_response.h"
+#include "mobile/show_constant_tbt_response.h"
+#include "mobile/show_response.h"
+#include "mobile/add_command_response.h"
+#include "mobile/send_location_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/set_display_layout_response.h"
+#include "mobile/generic_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/scrollable_message_response.h"
+#include "mobile/change_registration_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace simple_response_commands_test {
+
+namespace commands = ::application_manager::commands;
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+
+using commands::MessageSharedPtr;
+
+template <class Command>
+class MobileResponseCommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::ListFilesResponse,
+ commands::ReadDIDResponse,
+ commands::DeleteCommandResponse,
+ commands::AlertManeuverResponse,
+ commands::AlertResponse,
+ commands::SubscribeButtonResponse,
+ commands::AddSubMenuResponse,
+ commands::DiagnosticMessageResponse,
+ commands::DialNumberResponse,
+ commands::EndAudioPassThruResponse,
+ commands::GetDTCsResponse,
+ commands::GetVehicleDataResponse,
+ commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeWayPointsResponse,
+ commands::UpdateTurnListResponse,
+ commands::UnsubscribeButtonResponse,
+ commands::SliderResponse,
+ commands::SpeakResponse,
+ commands::SubscribeVehicleDataResponse,
+ commands::SubscribeWayPointsResponse,
+ commands::SystemResponse,
+ commands::GetWayPointsResponse,
+ commands::PerformInteractionResponse,
+ commands::PerformAudioPassThruResponse,
+ commands::SetGlobalPropertiesResponse,
+ commands::SetMediaClockTimerResponse,
+ commands::ShowConstantTBTResponse,
+ commands::ShowResponse,
+ commands::SystemResponse,
+ commands::AddCommandResponse,
+ commands::SendLocationResponse,
+ commands::SetAppIconResponse,
+ commands::SetDisplayLayoutResponse,
+ commands::ChangeRegistrationResponse> ResponseCommandsList;
+
+TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList);
+
+TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) {
+ ::utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_CALL(this->app_mngr_, SendMessageToMobile(NotNull(), _));
+ command->Run();
+}
+
+class GenericResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P2(CheckMessageParams, success, result, "") {
+ const bool is_msg_type_correct =
+ (am::MessageType::kResponse) ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::params][am::strings::message_type].asInt());
+ const bool is_success_correct =
+ success == (*arg)[am::strings::msg_params][am::strings::success].asBool();
+ const bool is_result_code_correct =
+ result ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(
+ true, is_msg_type_correct, is_success_correct, is_result_code_correct);
+}
+
+TEST_F(GenericResponseFromHMICommandsTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+
+ SharedPtr<commands::GenericResponse> command(
+ CreateCommand<commands::GenericResponse>(command_msg));
+
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(
+ CheckMessageParams(false, mobile_apis::Result::INVALID_DATA), false));
+
+ command->Run();
+}
+
+class ScrollableMessageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+
+ MockAppPtr app(CreateMockApp());
+
+ SharedPtr<am::commands::ScrollableMessageResponse> command(
+ CreateCommand<am::commands::ScrollableMessageResponse>(message));
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app));
+ EXPECT_CALL(*app, UnsubscribeFromSoftButtons(_));
+ command->Run();
+}
+
+} // namespace simple_response_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc
new file mode 100644
index 0000000000..7f260f7ddb
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/slider_test.cc
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "application_manager/commands/mobile/slider_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace slider_request {
+
+namespace am = application_manager;
+using am::commands::SliderRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using 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())
+ , mock_app_(CreateMockApp())
+ , msg_(CreateMessage(smart_objects::SmartType_Map)) {}
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void PreConditions() {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::num_ticks] = kNumTicks;
+ (*msg_)[am::strings::msg_params][am::strings::position] =
+ kPositionLessTicks;
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
+ "slider_footer1";
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][1] =
+ "slider_footer2";
+ (*msg_)[am::strings::msg_params][am::strings::slider_header] =
+ "slider_header";
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+ sync_primitives::Lock lock_;
+
+ MockMessageHelper& mock_message_helper_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ utils::SharedPtr<SliderRequest> command =
+ CreateCommand<SliderRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ 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;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ 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_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+ 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";
+
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::TIMED_OUT))
+ .WillOnce(Return(mobile_apis::Result::TIMED_OUT));
+ 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;
+
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::ABORTED))
+ .WillOnce(Return(mobile_apis::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
new file mode 100644
index 0000000000..58eec42902
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/speak_request_test.cc
@@ -0,0 +1,420 @@
+/*
+
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "gtest/gtest.h"
+#include "mobile/speak_request.h"
+#include "utils/shared_ptr.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/shared_ptr.h"
+#include "utils/helpers.h"
+#include "utils/make_shared.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/application.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace speak_request {
+
+namespace am = application_manager;
+namespace mobile_result = mobile_apis::Result;
+namespace hmi_response = ::application_manager::hmi_response;
+namespace strings = ::application_manager::strings;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using ::testing::_;
+using ::utils::SharedPtr;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using am::commands::SpeakRequest;
+using ::test::components::application_manager_test::MockApplication;
+
+typedef SharedPtr<SpeakRequest> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 10u;
+const uint32_t kConnectionKey = 5u;
+}
+
+class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SpeakRequestTest()
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
+ , request_(CreateMessage(smart_objects::SmartType_Map))
+ , response_(CreateMessage(smart_objects::SmartType_Map))
+ , app_(CreateMockApp()) {
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ ~SpeakRequestTest() {
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success) {
+ utils::SharedPtr<SpeakRequest> command =
+ CreateCommand<SpeakRequest>(request_);
+
+ (*response_)[strings::params][hmi_response::code] = hmi_response;
+ (*response_)[strings::msg_params] = 0;
+
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ MessageSharedPtr response_to_mobile;
+ 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(app_mngr_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ success);
+ EXPECT_EQ((*response_to_mobile)[strings::msg_params][strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+
+ am::MockMessageHelper& mock_message_helper_;
+ MessageSharedPtr request_;
+ MessageSharedPtr response_;
+ MockAppPtr app_;
+};
+
+TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) {
+ utils::SharedPtr<SpeakRequest> command =
+ CreateCommand<SpeakRequest>(request_);
+
+ (*response_)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response_)[strings::msg_params] = 0;
+
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::SUCCESS))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(mobile_apis::Result::SUCCESS));
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true);
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE,
+ false);
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_NOT_RESPONSE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ true);
+}
+
+TEST_F(SpeakRequestTest, Run_ApplicationIsNotRegistered) {
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithWhiteSpace_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = " ";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar1_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\\t";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar2_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\\n";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar3_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\tdf";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar4_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\n rer";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectCharInfirstPlace_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "\n";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithEmptyString_Success) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgCorrect_Success) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "asda";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ CommandPtr command(CreateCommand<SpeakRequest>());
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_Speak_SUCCESS) {
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "1234";
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_result))
+ .WillOnce(Return(am::mobile_api::Result::SUCCESS));
+ 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(mock_message_helper_, HMIToMobileResult(hmi_result))
+ .WillOnce(Return(am::mobile_api::Result::WARNINGS));
+ 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
new file mode 100644
index 0000000000..8d31b67a53
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/include/application_manager/commands/mobile/subscribe_button_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace subscribe_button_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using am::commands::SubscribeButtonRequest;
+using am::commands::MessageSharedPtr;
+
+typedef SharedPtr<SubscribeButtonRequest> CommandPtr;
+
+class SubscribeButtonRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+};
+
+typedef SubscribeButtonRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(SharedPtr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SubscriptionNotAllowed_UNSUCCESS) {
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] =
+ mobile_apis::ButtonName::SEEKLEFT;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_UiIsNotSupported_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>());
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ MockHMICapabilities hmi_capabilities;
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(hmi_capabilities));
+ ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_IsSubscribedToButton_UNSUCCESS) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::SEEKLEFT;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ MockHMICapabilities hmi_capabilities;
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(hmi_capabilities));
+ ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+
+ ON_CALL(hmi_capabilities, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(true));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::IGNORED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::SEEKLEFT;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ MockHMICapabilities hmi_capabilities;
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(hmi_capabilities));
+ ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+
+ ON_CALL(hmi_capabilities, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
+
+ MessageSharedPtr hmi_result_msg;
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
+
+ MessageSharedPtr mobile_result_msg(
+ CatchMobileCommandResult(CallRun(*command)));
+
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*hmi_result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+} // namespace subscribe_button_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
index 35755a08bb..66cd740bbe 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
@@ -33,13 +33,14 @@
#include "gtest/gtest.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/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "mobile/subscribe_way_points_request.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,6 +48,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace subscribe_way_points_request {
using ::testing::_;
using ::testing::Return;
@@ -54,20 +56,16 @@ using ::testing::ReturnRef;
using ::testing::DoAll;
using ::testing::SaveArg;
using ::testing::InSequence;
+using ::testing::Mock;
namespace am = ::application_manager;
using am::commands::SubscribeWayPointsRequest;
using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
typedef SharedPtr<SubscribeWayPointsRequest> CommandPtr;
class SubscribeWayPointsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- typedef TypeIf<kMocksIsNice,
- NiceMock<application_manager_test::MockHMICapabilities>,
- application_manager_test::MockHMICapabilities>::Result
- MockHMICapabilities;
-};
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) {
CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
@@ -100,24 +98,34 @@ 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);
+ MockMessageHelper* mock_message_helper =
+ MockMessageHelper::message_helper_mock();
+ Mock::VerifyAndClearExpectations(mock_message_helper);
+
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
{
InSequence dummy;
EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_));
+ EXPECT_CALL(*mock_message_helper, HMIToMobileResult(result_code))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
EXPECT_CALL(*app, UpdateHash());
}
command->on_event(event);
+
+ Mock::VerifyAndClearExpectations(mock_message_helper);
}
+} // namespace subscribe_way_points_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
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
new file mode 100644
index 0000000000..7cc5e59470
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/mobile/unregister_app_interface_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unregister_app_interface_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using am::commands::UnregisterAppInterfaceRequest;
+using am::commands::MessageSharedPtr;
+
+typedef ::utils::SharedPtr<UnregisterAppInterfaceRequest> CommandPtr;
+
+class UnregisterAppInterfaceRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UnregisterAppInterfaceRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnregisterAppInterfaceRequestTest, Run_SUCCESS) {
+ const uint32_t kConnectionKey = 1u;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(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(),
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kConnectionKey, kUnregisterReason))
+ .WillOnce(Return(dummy_msg));
+ {
+ ::testing::InSequence sequence;
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(dummy_msg, _));
+
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kConnectionKey, mobile_apis::Result::SUCCESS, _, _));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ }
+
+ command->Run();
+}
+
+} // namespace unregister_app_interface_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc
new file mode 100644
index 0000000000..a71f8a43c8
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc
@@ -0,0 +1,105 @@
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/mobile/unsubscribe_button_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_button_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using am::commands::UnsubscribeButtonRequest;
+using am::commands::MessageSharedPtr;
+
+typedef ::utils::SharedPtr<UnsubscribeButtonRequest> CommandPtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK;
+} // namespace
+
+class UnsubscribeButtonRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UnsubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest,
+ Run_UnsubscribeNotSubscribedButton_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
+
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
+ const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK;
+
+ 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));
+
+ EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ EXPECT_CALL(*mock_app, UpdateHash());
+
+ command->Run();
+}
+
+} // namespace unsubscribe_button_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
new file mode 100644
index 0000000000..eae368347e
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_vehicle_data_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using am::commands::UnsubscribeVehicleDataRequest;
+using am::commands::MessageSharedPtr;
+
+typedef ::utils::SharedPtr<UnsubscribeVehicleDataRequest> CommandPtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kMsgParamKey = "test_key";
+const am::VehicleDataType kVehicleType = am::VehicleDataType::SPEED;
+} // namespace
+
+class UnsubscribeVehicleRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void UnsubscribeSuccessfully();
+ sync_primitives::Lock app_set_lock_;
+};
+
+TEST_F(UnsubscribeVehicleRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>());
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_DataToUnsubscribeIsNotExisted_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] =
+ kVehicleType;
+
+ am::VehicleData data;
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+ .WillOnce(ReturnRef(data));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_UnsubscribeNotSubscribedBeforeData_IGNORED) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = kVehicleType;
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_UnsubscribeNotSubscribedBeforeData_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, Run_UnsubscribeDataDisabled_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+void UnsubscribeVehicleRequestTest::UnsubscribeSuccessfully() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), 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));
+
+ EXPECT_CALL(*mock_app, IsSubscribedToIVI(kVehicleType))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app, UnsubscribeFromIVI(kVehicleType))
+ .WillRepeatedly(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, Run_UnsubscribeData_SUCCESS) {
+ UnsubscribeSuccessfully();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ am::VehicleData vehicle_data;
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), 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->Run();
+
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ SmartObject message(smart_objects::SmartType_Map);
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+ 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_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+ EXPECT_CALL(*mock_app, UpdateHash());
+
+ command->on_event(test_event);
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataUnsubscribed_SUCCESS) {
+ UnsubscribeSuccessfully();
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+ MockAppPtr mock_app(CreateMockApp());
+
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ SmartObject message(smart_objects::SmartType_Map);
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+ 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
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc
new file mode 100644
index 0000000000..532948e5db
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc
@@ -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.
+ */
+
+#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
+#include <stdint.h>
+#include <string>
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_vehicle_data_response {
+
+namespace commands = ::application_manager::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+
+using commands::MessageSharedPtr;
+namespace am = ::application_manager;
+
+class UnsubscribeVehicleResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P(ResultCodeIs, result_code, "") {
+ return result_code ==
+ static_cast<mobile_apis::Result::eType>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendFalseResponseToMobile_SendInvalidEnum) {
+ MessageSharedPtr command_msg =
+ ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = false;
+
+ ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
+ CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(ResultCodeIs(mobile_apis::Result::INVALID_ENUM), _));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendSuccessfulResponseToMobile_SUCCESS) {
+ MessageSharedPtr command_msg =
+ ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = true;
+ ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
+ CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(ResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendResponseToMobile_SendCodeToMobile) {
+ MessageSharedPtr command_msg =
+ ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = true;
+
+ mobile_apis::Result::eType result_type = mobile_apis::Result::WARNINGS;
+ (*command_msg)[am::strings::msg_params][am::strings::result_code] =
+ result_type;
+ ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
+ CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(ResultCodeIs(result_type), _));
+ command->Run();
+}
+
+} // namespace unsubscribe_vehicle_data_response
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
index 0a5ff9745b..738cf35553 100644
--- 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
@@ -30,7 +30,12 @@
* 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"
@@ -38,61 +43,140 @@
#include "application_manager/application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "mobile/unsubscribe_way_points_request.h"
-#include "interfaces/MOBILE_API.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 ::testing::ReturnRef;
-using ::testing::DoAll;
-using ::testing::SaveArg;
-using ::testing::InSequence;
-namespace am = ::application_manager;
+
using am::commands::UnSubscribeWayPointsRequest;
using am::commands::MessageSharedPtr;
-typedef SharedPtr<UnSubscribeWayPointsRequest> CommandPtr;
+namespace {
+const uint32_t kConnectionKey = 3u;
+const uint32_t kAppId = 5u;
+} // namespace
-class UnsubscribeWayPointsRequestTest
+class UnSubscribeWayPointsRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- typedef TypeIf<kMocksIsNice,
- NiceMock<application_manager_test::MockHMICapabilities>,
- application_manager_test::MockHMICapabilities>::Result
- MockHMICapabilities;
+ UnSubscribeWayPointsRequestTest()
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<UnSubscribeWayPointsRequest>(command_msg_))
+ , mock_message_helper_(*am::MockMessageHelper::message_helper_mock()) {
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ ~UnSubscribeWayPointsRequestTest() {
+ testing::Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ MessageSharedPtr command_msg_;
+ ::utils::SharedPtr<UnSubscribeWayPointsRequest> command_;
+ am::MockMessageHelper& mock_message_helper_;
};
-TEST_F(UnsubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
- CommandPtr command(CreateCommand<UnSubscribeWayPointsRequest>());
- MockAppPtr app(CreateMockApp());
- Event event(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
+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::params][am::hmi_response::code] =
- mobile_apis::Result::SUCCESS;
(*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);
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
- {
- InSequence dummy;
- EXPECT_CALL(app_mngr_, UnsubscribeAppFromWayPoints(_));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*app, UpdateHash());
- }
+ EXPECT_CALL(app_mngr_, UnsubscribeAppFromWayPoints(kAppId));
+
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::SUCCESS))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
- command->on_event(event);
+ command_->on_event(event);
}
+} // namespace unsubscribe_way_points_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
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
new file mode 100644
index 0000000000..cab67e641c
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc
@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/update_turn_list_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace update_turn_list_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Ref;
+using ::testing::Eq;
+
+using am::commands::UpdateTurnListRequest;
+using am::commands::MessageSharedPtr;
+using application_manager_test::MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 3u;
+const hmi_apis::FunctionID::eType kFunctionId =
+ hmi_apis::FunctionID::Buttons_OnButtonEvent;
+const uint32_t kAppId = 5u;
+} // namespace
+
+class UpdateTurnListRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UpdateTurnListRequestTest()
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
+ , command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<UpdateTurnListRequest>(command_msg_)) {
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg_)[am::strings::params][am::strings::function_id] =
+ kFunctionId;
+ }
+
+ am::MockMessageHelper& mock_message_helper_;
+ MessageSharedPtr command_msg_;
+ ::utils::SharedPtr<UpdateTurnListRequest> command_;
+ TypeIf<kMocksAreNice,
+ NiceMock<policy_test::MockPolicyHandlerInterface>,
+ policy_test::MockPolicyHandlerInterface>::Result mock_policy_handler_;
+};
+
+TEST_F(UpdateTurnListRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_InvalidNavigationText_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "invalid_navigation_text\t\n";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_InvalidTurnIcon_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "valid_navigation_text";
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "invalid_turn_icon\t\n";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest,
+ Run_ProcessSoftButtonsNotSucceeded_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "valid_navigation_text";
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_));
+
+ const mobile_result::eType kExpectedResult = mobile_result::INVALID_ENUM;
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(kExpectedResult));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(kExpectedResult), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_NoTurnList_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) {
+ const std::string kNavigationText = "valid_navigation_text";
+
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = kNavigationText;
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+ (*command_msg_)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon],
+ Eq(mock_app),
+ Ref(app_mngr_))).WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(_, _, kFunctionId));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ ASSERT_TRUE(result_msg);
+ EXPECT_EQ(
+ hmi_apis::FunctionID::Navigation_UpdateTurnList,
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ ASSERT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ .keyExists(am::hmi_request::navi_text));
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_name));
+ EXPECT_EQ(
+ hmi_apis::Common_TextFieldName::turnText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_name]
+ .asInt());
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_text));
+ EXPECT_EQ(
+ kNavigationText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_text]
+ .asString());
+}
+
+TEST_F(UpdateTurnListRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ command_->on_event(event);
+}
+
+TEST_F(UpdateTurnListRequestTest, OnEvent_UnsupportedResource_SUCCESS) {
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ const mobile_result::eType mobile_response_code =
+ mobile_result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_response_code))
+ .WillOnce(Return(mobile_response_code));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command_->on_event(event);
+}
+
+TEST_F(UpdateTurnListRequestTest,
+ OnEvent_ReceivedNavigationUpdateTurnListEvent_SUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ const mobile_result::eType mobile_response_code = mobile_result::SUCCESS;
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_response_code))
+ .WillOnce(Return(mobile_response_code));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command_->on_event(event);
+}
+
+} // namespace update_turn_list_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc
index 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..61cda5ce43 100644
--- a/src/components/application_manager/test/hmi_capabilities.json
+++ b/src/components/application_manager/test/hmi_capabilities.json
@@ -2,7 +2,7 @@
"UI":
{
"language":"EN_US",
- "languages":[
+ "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"
],
@@ -250,7 +250,7 @@
"name":"graphic",
"imageTypeSupported":
[
-
+
],
"imageResolution":
{
@@ -270,7 +270,7 @@
"resolutionHeight":35
}
}
-
+
],
"mediaClockFormats":
[
@@ -279,7 +279,7 @@
"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",
@@ -335,15 +335,15 @@
{
"capabilities":["TEXT"],
"language":"ES_MX",
- "languages":
- [
+ "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",
+ "capabilities":["TEXT"],
"language":"DE_DE",
"languages":
[
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index 1ed2123eba..4eb9f920d9 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_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,6 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string>
+
#include "application_manager/hmi_capabilities.h"
#include "gtest/gtest.h"
#include "smart_objects/smart_object.h"
@@ -43,7 +45,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 {
@@ -57,19 +59,20 @@ using ::testing::AtLeast;
using ::testing::Invoke;
using ::testing::InSequence;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
using namespace application_manager;
class HMICapabilitiesTest : public ::testing::Test {
protected:
- HMICapabilitiesTest() : last_state_("app_storage_folder", "app_info_data") {}
+ HMICapabilitiesTest()
+ : last_state_("app_storage_folder", "app_info_data")
+ , file_name_("hmi_capabilities.json") {}
virtual void SetUp() OVERRIDE {
EXPECT_CALL(app_mngr_, event_dispatcher())
.WillOnce(ReturnRef(mock_event_dispatcher));
EXPECT_CALL(app_mngr_, get_settings())
.WillRepeatedly(ReturnRef(mock_application_manager_settings_));
EXPECT_CALL(mock_application_manager_settings_,
- hmi_capabilities_file_name()).WillOnce(ReturnRef(kFileName));
+ hmi_capabilities_file_name()).WillOnce(ReturnRef(file_name_));
EXPECT_CALL(mock_event_dispatcher, add_observer(_, _, _)).Times(1);
EXPECT_CALL(mock_event_dispatcher, remove_observer(_)).Times(1);
EXPECT_CALL(mock_application_manager_settings_, launch_hmi())
@@ -91,10 +94,10 @@ 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 kFileName = "hmi_capabilities.json";
+ const std::string file_name_;
};
const char* const cstring_values_[] = {
@@ -226,6 +229,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());
@@ -349,75 +359,6 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
EXPECT_EQ("SE", vehicle_type_so["trim"].asString());
}
-TEST_F(HMICapabilitiesTest, ConvertJsonLanguagesToObj) {
- Json::Value json_languages(Json::arrayValue);
- json_languages[0] = "EN_US";
- json_languages[1] = "ES_MX";
- smart_objects::SmartObject sm_obj =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CommonLanguageFromString(json_languages[0].asString()))
- .WillOnce(Return(hmi_apis::Common_Language::EN_US));
-
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CommonLanguageFromString(json_languages[1].asString()))
- .WillOnce(Return(hmi_apis::Common_Language::ES_MX));
-
- hmi_capabilities_test->ConvertJsonLanguagesToObj(json_languages, sm_obj);
-
- EXPECT_EQ(hmi_apis::Common_Language::EN_US,
- static_cast<hmi_apis::Common_Language::eType>(sm_obj[0].asInt()));
- EXPECT_EQ(hmi_apis::Common_Language::ES_MX,
- static_cast<hmi_apis::Common_Language::eType>(sm_obj[1].asInt()));
-}
-
-TEST_F(HMICapabilitiesTest,
- HmiCapabilitiesInitialized_UiVrTtsIviNotCooperating) {
- // Precondition
- hmi_capabilities_test->set_is_vr_cooperating(false);
- hmi_capabilities_test->set_is_tts_cooperating(false);
-
- hmi_capabilities_test->set_is_ui_cooperating(false);
- hmi_capabilities_test->set_is_navi_cooperating(false);
- hmi_capabilities_test->set_is_ivi_cooperating(false);
- EXPECT_TRUE(hmi_capabilities_test->is_hmi_capabilities_initialized());
-}
-
-TEST_F(HMICapabilitiesTest, HmiCapabilitiesInitialized) {
- // Precondition
- SetCooperating();
- smart_objects::SmartObjectSPtr language(
- new smart_objects::SmartObject(smart_objects::SmartType_Map));
-
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(_, _)).WillRepeatedly(Return(language));
-
- hmi_capabilities_test->set_is_vr_cooperating(true);
- smart_objects::SmartObject supported_languages;
- supported_languages[0] = "EN_US";
- hmi_capabilities_test->set_vr_supported_languages(supported_languages);
- hmi_capabilities_test->set_tts_supported_languages(supported_languages);
- hmi_capabilities_test->set_ui_supported_languages(supported_languages);
- hmi_capabilities_test->set_vehicle_type(supported_languages);
-
- hmi_capabilities_test->set_is_tts_cooperating(true);
- hmi_capabilities_test->set_is_ui_cooperating(true);
- hmi_capabilities_test->set_is_navi_cooperating(true);
- hmi_capabilities_test->set_is_ivi_cooperating(true);
-
- hmi_capabilities_test->set_active_vr_language(
- hmi_apis::Common_Language::EN_US);
- SetCooperating();
- hmi_capabilities_test->set_active_tts_language(
- hmi_apis::Common_Language::EN_US);
- SetCooperating();
- hmi_capabilities_test->set_active_ui_language(
- hmi_apis::Common_Language::EN_US);
-
- EXPECT_TRUE(hmi_capabilities_test->is_hmi_capabilities_initialized());
-}
-
TEST_F(HMICapabilitiesTest, VerifyImageType) {
const int32_t image_type = 1;
smart_objects::SmartObject sm_obj;
@@ -438,88 +379,23 @@ void HMICapabilitiesTest::SetCooperating() {
}
TEST_F(HMICapabilitiesTest, SetVRCooperating) {
- // Without sequence it is impossible to check correct call of ManageHMICommand
- InSequence dummy;
- smart_objects::SmartObjectSPtr language(
- new smart_objects::SmartObject(smart_objects::SmartType_Map));
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _))
- .WillOnce(Return(language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(language));
-
- smart_objects::SmartObjectSPtr support_language;
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages,
- _)).WillOnce(Return(support_language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(support_language));
-
- smart_objects::SmartObjectSPtr capabilities;
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _))
- .WillOnce(Return(capabilities));
- EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
-
hmi_capabilities_test->set_is_vr_cooperating(true);
+ EXPECT_EQ(true, hmi_capabilities_test->is_vr_cooperating());
}
TEST_F(HMICapabilitiesTest, SetTTSCooperating) {
- smart_objects::SmartObjectSPtr language(
- new smart_objects::SmartObject(smart_objects::SmartType_Map));
- InSequence dummy;
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage, _))
- .WillOnce(Return(language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(language));
-
- smart_objects::SmartObjectSPtr support_language;
- EXPECT_CALL(
- *(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetSupportedLanguages, _))
- .WillOnce(Return(support_language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(support_language));
-
- smart_objects::SmartObjectSPtr capabilities;
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetCapabilities, _))
- .WillOnce(Return(capabilities));
- EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
-
hmi_capabilities_test->set_is_tts_cooperating(true);
+ EXPECT_EQ(true, hmi_capabilities_test->is_tts_cooperating());
}
TEST_F(HMICapabilitiesTest, SetUICooperating) {
- InSequence dummy;
- smart_objects::SmartObjectSPtr language(
- new smart_objects::SmartObject(smart_objects::SmartType_Map));
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, _))
- .WillOnce(Return(language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(language));
-
- smart_objects::SmartObjectSPtr support_language;
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages,
- _)).WillOnce(Return(support_language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(support_language));
-
- smart_objects::SmartObjectSPtr capabilities;
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetCapabilities, _))
- .WillOnce(Return(capabilities));
- EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
-
hmi_capabilities_test->set_is_ui_cooperating(true);
+ EXPECT_EQ(true, hmi_capabilities_test->is_ui_cooperating());
}
TEST_F(HMICapabilitiesTest, SetIviCooperating) {
- smart_objects::SmartObjectSPtr ivi_type;
- EXPECT_CALL(
- *(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _))
- .WillOnce(Return(ivi_type));
- EXPECT_CALL(app_mngr_, ManageHMICommand(ivi_type));
-
hmi_capabilities_test->set_is_ivi_cooperating(true);
+ EXPECT_EQ(true, hmi_capabilities_test->is_ivi_cooperating());
}
} // namespace application_manager_test
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
new file mode 100644
index 0000000000..e5a45c1549
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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_COMMAND_RESPONSES_TEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_COMMAND_RESPONSES_TEST_H_
+
+#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_request_impl.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::SaveArg;
+using ::testing::DoAll;
+using ::testing::NiceMock;
+using ::test::components::event_engine_test::MockEventDispatcher;
+namespace am = ::application_manager;
+using am::commands::Command;
+using am::commands::CommandRequestImpl;
+using am::event_engine::Event;
+
+class CallRun {
+ public:
+ CallRun(CommandRequestImpl& command) : command_(command) {}
+
+ void operator()() {
+ command_.Run();
+ }
+
+ CommandRequestImpl& command_;
+};
+
+class CallOnEvent {
+ public:
+ CallOnEvent(CommandRequestImpl& command, Event& event)
+ : command_(command), event_(event) {}
+
+ void operator()() {
+ command_.on_event(event_);
+ }
+
+ CommandRequestImpl& command_;
+ Event& event_;
+};
+
+template <const CommandsTestMocks kIsNice = CommandsTestMocks::kNotNice>
+class CommandRequestTest : public CommandsTest<kIsNice> {
+ public:
+ typedef typename TypeIf<kIsNice,
+ NiceMock<MockEventDispatcher>,
+ MockEventDispatcher>::Result MockEventDisp;
+
+ template <class CallableT>
+ MessageSharedPtr CatchMobileCommandResult(CallableT delegate,
+ bool call_return = true) {
+ MessageSharedPtr result_msg;
+ EXPECT_CALL(this->app_mngr_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(call_return)));
+ delegate();
+ return result_msg;
+ }
+
+ template <class CallableT>
+ MessageSharedPtr CatchHMICommandResult(CallableT delegate,
+ bool call_return = true) {
+ MessageSharedPtr result_msg;
+ EXPECT_CALL(this->app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(call_return)));
+ delegate();
+ return result_msg;
+ }
+
+ MockEventDisp event_dispatcher_;
+
+ protected:
+ CommandRequestTest() : CommandsTest<kIsNice>() {}
+
+ virtual void InitCommand(const uint32_t& default_timeout) OVERRIDE {
+ CommandsTest<kIsNice>::InitCommand(default_timeout);
+ ON_CALL(CommandsTest<kIsNice>::app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ }
+};
+
+} // namespace commands_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_COMMAND_RESPONSES_TEST_H_
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
new file mode 100644
index 0000000000..b6733b5818
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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_COMMANDS_TEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_COMMANDS_TEST_H_
+
+#include <stdint.h>
+#include "gtest/gtest.h"
+
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command.h"
+#include "utils/make_shared.h"
+#include "application_manager/mock_application_manager.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+
+namespace am = ::application_manager;
+
+using ::testing::ReturnRef;
+using ::testing::Return;
+using ::testing::NiceMock;
+using ::testing::_;
+
+using ::utils::SharedPtr;
+using ::smart_objects::SmartObject;
+using am::commands::MessageSharedPtr;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using am::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+// Depending on the value type will be selected
+template <const bool kIf, class ThenT, class ElseT>
+struct TypeIf {
+ typedef ThenT Result;
+};
+template <class ThenT, class ElseT>
+struct TypeIf<false, ThenT, ElseT> {
+ typedef ElseT Result;
+};
+
+template <class MockT, bool kIsNice>
+struct IsNiceMock : public TypeIf<kIsNice, ::testing::NiceMock<MockT>, MockT> {
+};
+
+#define MOCK(Type) typename IsNiceMock<Type, kMocksAreNice>::Result
+
+// If `kIsNice` is `true` then all used mock types
+// will be wrapped by a `NiceMock`
+
+enum CommandsTestMocks { kNotNice = 0, kIsNice };
+
+template <const CommandsTestMocks kIsNice = CommandsTestMocks::kNotNice>
+class CommandsTest : public ::testing::Test {
+ public:
+ enum { kMocksAreNice = kIsNice };
+
+ typedef NiceMock<MockApplicationManagerSettings> MockAppManagerSettings;
+ typedef typename TypeIf<kIsNice,
+ NiceMock<MockApplicationManager>,
+ MockApplicationManager>::Result MockAppManager;
+ typedef typename TypeIf<kIsNice,
+ NiceMock<MockApplication>,
+ MockApplication>::Result MockApp;
+ typedef SharedPtr<MockApp> MockAppPtr;
+
+ virtual ~CommandsTest() {}
+
+ static MessageSharedPtr CreateMessage(
+ const smart_objects::SmartType type = smart_objects::SmartType_Null) {
+ return ::utils::MakeShared<SmartObject>(type);
+ }
+
+ static MockAppPtr CreateMockApp() {
+ return ::utils::MakeShared<MockApp>();
+ }
+
+ template <class Command>
+ SharedPtr<Command> CreateCommand(const uint32_t timeout,
+ MessageSharedPtr& msg) {
+ InitCommand(timeout);
+ return ::utils::MakeShared<Command>((msg ? msg : msg = CreateMessage()),
+ app_mngr_);
+ }
+
+ template <class Command>
+ SharedPtr<Command> CreateCommand(MessageSharedPtr& msg) {
+ return CreateCommand<Command>(kDefaultTimeout_, msg);
+ }
+
+ template <class Command>
+ SharedPtr<Command> CreateCommand(const uint32_t timeout = kDefaultTimeout_) {
+ InitCommand(timeout);
+ MessageSharedPtr msg = CreateMessage();
+ return ::utils::MakeShared<Command>(msg, app_mngr_);
+ }
+
+ enum { kDefaultTimeout_ = 100 };
+
+ MockAppManager app_mngr_;
+ MockAppManagerSettings app_mngr_settings_;
+ MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+
+ protected:
+ virtual void InitCommand(const uint32_t& timeout) {
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(timeout));
+ }
+
+ CommandsTest() {
+ 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));
+ }
+};
+
+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
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_COMMANDS_TEST_H_
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/hmi_capabilities_for_testing.h b/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h
index ec8e92e859..9764a9997f 100644
--- a/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h
+++ b/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.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
@@ -33,26 +33,20 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_FOR_TESTING_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_FOR_TESTING_H_
-#include "application_manager/hmi_capabilities.h"
+#include "application_manager/hmi_capabilities_impl.h"
namespace test {
namespace components {
namespace application_manager_test {
class HMICapabilitiesForTesting
- : public ::application_manager::HMICapabilities {
+ : public ::application_manager::HMICapabilitiesImpl {
public:
HMICapabilitiesForTesting(::application_manager::ApplicationManager& app_mngr)
- : HMICapabilities(app_mngr) {}
+ : HMICapabilitiesImpl(app_mngr) {}
bool LoadCapabilitiesFromFile() {
return load_capabilities_from_file();
}
-
- void ConvertJsonLanguagesToObj(
- Json::Value& json_languages,
- ::NsSmartDeviceLink::NsSmartObjects::SmartObject& languages) {
- convert_json_languages_to_obj(json_languages, languages);
- }
};
} // namespace application_manager_test
diff --git a/src/components/application_manager/test/include/application_manager/mock_app_launch_ctrl.h b/src/components/application_manager/test/include/application_manager/mock_app_launch_ctrl.h
new file mode 100644
index 0000000000..181b8c4691
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_app_launch_ctrl.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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_APP_LAUNCH_CTRL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_LAUNCH_CTRL_H_
+
+#include "application_manager/app_launch/app_launch_ctrl.h"
+
+namespace test {
+namespace components {
+namespace app_launch_test {
+
+class AppLaunchCtrlMock : public app_launch::AppLaunchCtrl {};
+
+} // namespace app_launch_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_LAUNCH_CTRL_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h b/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h
new file mode 100644
index 0000000000..881ebb2575
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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_APP_LAUNCH_DATA_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_LAUNCH_DATA_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/app_launch/app_launch_data.h"
+
+namespace test {
+namespace components {
+namespace app_launch_test {
+
+class AppLaunchDataMock : public app_launch::AppLaunchData {
+ // AppLaunchData interface
+ public:
+ MOCK_METHOD1(AddApplicationData, bool(const app_launch::ApplicationData&));
+ MOCK_METHOD1(GetApplicationDataByDevice,
+ std::vector<app_launch::ApplicationDataPtr>(const std::string&));
+ MOCK_METHOD0(Clear, bool());
+ MOCK_METHOD0(Persist, bool());
+};
+
+} // namespace app_launch_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_LAUNCH_DATA_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 066ad9baae..2617f777bb 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
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,13 +36,13 @@
#include "application_manager/application.h"
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
+#include "application_manager/usage_statistics.h"
namespace test {
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() {}
@@ -67,6 +67,7 @@ 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_METHOD1(StartStreaming,
void(protocol_handler::ServiceType service_type));
MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type));
@@ -142,7 +143,7 @@ class MockApplication : public ::application_manager::Application {
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,
+ MOCK_METHOD2(AreCommandLimitsExceeded,
bool(mobile_apis::FunctionID::eType cmd_id,
::application_manager::TLimitSource source));
MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
@@ -271,11 +272,15 @@ class MockApplication : public ::application_manager::Application {
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_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());
};
} // namespace application_manager_test
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 6ad8aeb250..0000000000
--- a/src/components/application_manager/test/include/application_manager/mock_application_manager.h
+++ /dev/null
@@ -1,248 +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"
-
-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_METHOD2(TerminateRequest,
- void(uint32_t connection_key, uint32_t corr_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_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
new file mode 100644
index 0000000000..a8664f5e2c
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.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_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_CAPABILITIES_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_CAPABILITIES_H_
+
+#include <stdint.h>
+
+#include "application_manager/hmi_capabilities.h"
+#include "gmock/gmock.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockHMICapabilities : public ::application_manager::HMICapabilities {
+ public:
+ MOCK_CONST_METHOD1(VerifyImageType, bool(const int32_t image_type));
+
+ MOCK_CONST_METHOD0(is_vr_cooperating, bool());
+ MOCK_METHOD1(set_is_vr_cooperating, void(const bool value));
+
+ MOCK_CONST_METHOD0(is_tts_cooperating, bool());
+ MOCK_METHOD1(set_is_tts_cooperating, void(const bool value));
+
+ MOCK_CONST_METHOD0(is_ui_cooperating, bool());
+ MOCK_METHOD1(set_is_ui_cooperating, void(const bool value));
+
+ MOCK_CONST_METHOD0(is_navi_cooperating, bool());
+ MOCK_METHOD1(set_is_navi_cooperating, void(const bool value));
+
+ MOCK_CONST_METHOD0(is_ivi_cooperating, bool());
+ MOCK_METHOD1(set_is_ivi_cooperating, void(const bool value));
+
+ MOCK_CONST_METHOD0(attenuated_supported, bool());
+
+ MOCK_METHOD1(set_attenuated_supported, void(const bool state));
+
+ MOCK_CONST_METHOD0(active_ui_language,
+ const hmi_apis::Common_Language::eType());
+
+ MOCK_METHOD1(set_active_ui_language,
+ void(const hmi_apis::Common_Language::eType language));
+
+ MOCK_CONST_METHOD0(ui_supported_languages,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_ui_supported_languages,
+ void(const smart_objects::SmartObject& supported_languages));
+
+ MOCK_CONST_METHOD0(active_vr_language,
+ const hmi_apis::Common_Language::eType());
+ MOCK_METHOD1(set_active_vr_language,
+ void(const hmi_apis::Common_Language::eType language));
+
+ MOCK_CONST_METHOD0(vr_supported_languages,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_vr_supported_languages,
+ void(const smart_objects::SmartObject& supported_languages));
+
+ MOCK_CONST_METHOD0(active_tts_language,
+ const hmi_apis::Common_Language::eType());
+ MOCK_METHOD1(set_active_tts_language,
+ void(const hmi_apis::Common_Language::eType language));
+
+ MOCK_CONST_METHOD0(tts_supported_languages,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_tts_supported_languages,
+ void(const smart_objects::SmartObject& supported_languages));
+
+ MOCK_CONST_METHOD0(display_capabilities, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_display_capabilities,
+ void(const smart_objects::SmartObject& display_capabilities));
+
+ MOCK_CONST_METHOD0(hmi_zone_capabilities,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_hmi_zone_capabilities,
+ void(const smart_objects::SmartObject& hmi_zone_capabilities));
+
+ MOCK_CONST_METHOD0(soft_button_capabilities,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(
+ set_soft_button_capabilities,
+ void(const smart_objects::SmartObject& soft_button_capabilities));
+
+ MOCK_CONST_METHOD0(button_capabilities, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_button_capabilities,
+ void(const smart_objects::SmartObject& button_capabilities));
+
+ MOCK_CONST_METHOD0(speech_capabilities, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_speech_capabilities,
+ void(const smart_objects::SmartObject& speech_capabilities));
+
+ MOCK_CONST_METHOD0(vr_capabilities, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_vr_capabilities,
+ void(const smart_objects::SmartObject& vr_capabilities));
+
+ MOCK_CONST_METHOD0(audio_pass_thru_capabilities,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(
+ set_audio_pass_thru_capabilities,
+ void(const smart_objects::SmartObject& audio_pass_thru_capabilities));
+
+ MOCK_CONST_METHOD0(pcm_stream_capabilities,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_pcm_stream_capabilities,
+ void(const smart_objects::SmartObject& pcm_stream_capabilities));
+
+ MOCK_CONST_METHOD0(preset_bank_capabilities,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(
+ set_preset_bank_capabilities,
+ void(const smart_objects::SmartObject& preset_bank_capabilities));
+
+ MOCK_CONST_METHOD0(vehicle_type, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_vehicle_type,
+ void(const smart_objects::SmartObject& vehicle_type));
+
+ MOCK_CONST_METHOD0(prerecorded_speech, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_prerecorded_speech,
+ void(const smart_objects::SmartObject& prerecorded_speech));
+
+ MOCK_CONST_METHOD0(navigation_supported, bool());
+ MOCK_METHOD1(set_navigation_supported, void(const bool supported));
+
+ MOCK_CONST_METHOD0(phone_call_supported, bool());
+ MOCK_METHOD1(set_phone_call_supported, void(const bool supported));
+
+ MOCK_METHOD1(Init, void(resumption::LastState* last_state));
+
+ MOCK_CONST_METHOD0(ccpu_version, const std::string&());
+ MOCK_METHOD1(set_ccpu_version, void(const std::string& ccpu_version));
+ MOCK_METHOD0(get_hmi_language_handler,
+ application_manager::HMILanguageHandler&());
+ MOCK_METHOD1(set_handle_response_for,
+ void(const smart_objects::SmartObject& request));
+
+ protected:
+ MOCK_CONST_METHOD2(check_existing_json_member,
+ bool(const Json::Value& json_member,
+ const char* name_of_member));
+
+ MOCK_CONST_METHOD2(convert_json_languages_to_obj,
+ void(const Json::Value& json_languages,
+ smart_objects::SmartObject& languages));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_CAPABILITIES_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_interface.h b/src/components/application_manager/test/include/application_manager/mock_hmi_interface.h
new file mode 100644
index 0000000000..c38e2711f5
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_hmi_interface.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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_INTERFACE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_INTERFACE_H_
+
+#include "gmock/gmock.h"
+
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/hmi_interfaces_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+class MockHmiInterfaces : public application_manager::HmiInterfaces {
+ public:
+ MOCK_CONST_METHOD1(GetInterfaceState,
+ HmiInterfaces::InterfaceState(HmiInterfaces::InterfaceID));
+ MOCK_CONST_METHOD1(GetInterfaceFromFunction,
+ HmiInterfaces::InterfaceID(hmi_apis::FunctionID::eType));
+ MOCK_METHOD2(SetInterfaceState,
+ void(HmiInterfaces::InterfaceID, HmiInterfaces::InterfaceState));
+};
+
+} // namespace application_manager
+
+#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_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index 289b20a105..0d28f9e522 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,18 +30,19 @@
* 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"
#include "interfaces/HMI_API.h"
#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,
@@ -64,9 +65,11 @@ 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_METHOD2(SendNaviStartStream,
void(int32_t connection_key, ApplicationManager& app_mngr));
MOCK_METHOD2(SendNaviStopStream,
@@ -109,14 +112,26 @@ class MockMessageHelper {
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,
@@ -151,9 +166,13 @@ class MockMessageHelper {
smart_objects::SmartObjectList(ApplicationSharedPtr app));
MOCK_METHOD3(VerifyImageFiles,
mobile_apis::Result::eType(smart_objects::SmartObject& message,
-
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr));
+ MOCK_METHOD3(VerifyImage,
+ mobile_apis::Result::eType(smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
+
MOCK_METHOD6(GetBCActivateAppRequestToHMI,
smart_objects::SmartObjectSPtr(
ApplicationConstSharedPtr app,
@@ -166,9 +185,81 @@ class MockMessageHelper {
NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr(
int32_t connection_key,
mobile_apis::AppInterfaceUnregisteredReason::eType reason));
+ MOCK_METHOD4(ProcessSoftButtons,
+ mobile_apis::Result::eType(
+ smart_objects::SmartObject& message_params,
+ ApplicationConstSharedPtr app,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SubscribeApplicationToSoftButton,
+ void(smart_objects::SmartObject& message_params,
+ ApplicationSharedPtr app,
+ int32_t function_id));
+ MOCK_METHOD4(CreateNegativeResponse,
+ smart_objects::SmartObjectSPtr(uint32_t connection_key,
+ int32_t function_id,
+ const uint32_t correlation_id,
+ int32_t result_code));
+ MOCK_METHOD4(
+ CreateBlockedByPoliciesResponse,
+ smart_objects::SmartObjectSPtr(mobile_apis::FunctionID::eType function_id,
+ mobile_apis::Result::eType result,
+ const uint32_t correlation_id,
+ uint32_t connection_key));
+ MOCK_METHOD0(vehicle_data, const VehicleData&());
+ MOCK_METHOD1(SendStopAudioPathThru, bool(ApplicationManager& app_mngr));
+ MOCK_METHOD1(StringifiedFunctionID,
+ std::string(const mobile_apis::FunctionID::eType function_id));
+ MOCK_METHOD2(SendUIChangeRegistrationRequestToHMI,
+ void(ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD5(CreateHMIApplicationStruct,
+ bool(ApplicationConstSharedPtr app,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ smart_objects::SmartObject* output,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendOnAppUnregNotificationToHMI,
+ void(ApplicationConstSharedPtr app,
+ const bool is_unexpected_disconnect,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD4(SendLaunchApp,
+ void(const uint32_t connection_key,
+ const std::string& urlSchema,
+ const std::string& packageName,
+ ApplicationManager& app_man));
+ MOCK_METHOD1(SendUnsubscribedWayPoints, bool(ApplicationManager& app_mngr));
+
+ MOCK_METHOD2(SendQueryApps,
+ void(const uint32_t connection_key,
+ ApplicationManager& app_man));
+ MOCK_METHOD1(CreateAppVrHelp,
+ smart_objects::SmartObjectSPtr(ApplicationConstSharedPtr app));
+ MOCK_METHOD3(VerifyImageVrHelpItems,
+ mobile_apis::Result::eType(smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
+
+ MOCK_METHOD1(GetPriorityCode, const uint32_t(const std::string& priority));
+
+ MOCK_METHOD1(PrintSmartObject,
+ bool(const smart_objects::SmartObject& object));
+ MOCK_METHOD3(SendTTSGlobalProperties,
+ void(ApplicationSharedPtr app,
+ const bool default_help_prompt,
+ ApplicationManager& app_man));
+ MOCK_METHOD3(SendSetAppIcon,
+ void(const uint32_t app_id,
+ const std::string& icon_path,
+ 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));
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
new file mode 100644
index 0000000000..b06b207f84
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.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_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUME_CTRL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUME_CTRL_H_
+#include "gmock/gmock.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/application.h"
+#include "resumption/last_state.h"
+
+namespace test {
+namespace components {
+namespace resumprion_test {
+
+class MockResumeCtrl : public resumption::ResumeCtrl {
+ public:
+ MOCK_METHOD0(SaveAllApplications, void());
+ MOCK_METHOD1(SaveApplication,
+ void(app_mngr::ApplicationSharedPtr application));
+ MOCK_METHOD1(RemoveApplicationFromSaved,
+ bool(app_mngr::ApplicationConstSharedPtr application));
+ MOCK_METHOD0(OnSuspend, void());
+ MOCK_METHOD0(OnAwake, void());
+ MOCK_METHOD0(StopSavePersistentDataTimer, void());
+ MOCK_METHOD2(StartResumption,
+ bool(app_mngr::ApplicationSharedPtr application,
+ const std::string& hash));
+ MOCK_METHOD1(StartResumptionOnlyHMILevel,
+ bool(app_mngr::ApplicationSharedPtr application));
+ MOCK_METHOD1(CheckPersistenceFilesForResumption,
+ bool(app_mngr::ApplicationSharedPtr application));
+ MOCK_METHOD2(CheckApplicationHash,
+ bool(app_mngr::ApplicationSharedPtr application,
+ const std::string& hash));
+ MOCK_METHOD1(IsHMIApplicationIdExist, bool(uint32_t hmi_app_id));
+ MOCK_METHOD2(IsApplicationSaved,
+ bool(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_CONST_METHOD2(GetHMIApplicationID,
+ uint32_t(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_METHOD0(ApplicationsDataUpdated, void());
+ MOCK_METHOD0(ResetLaunchTime, void());
+ MOCK_METHOD1(OnAppActivated,
+ void(app_mngr::ApplicationSharedPtr application));
+ MOCK_METHOD1(RemoveFromResumption, void(uint32_t app_id));
+ MOCK_METHOD1(Init, bool(resumption::LastState& last_state));
+ MOCK_METHOD2(OnAppRegistrationStart,
+ void(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_METHOD0(OnAppRegistrationEnd, void());
+ MOCK_CONST_METHOD2(GetSavedAppHmiLevel,
+ int32_t(const std::string&, const std::string&));
+ MOCK_METHOD1(RestoreAppHMIState,
+ bool(application_manager::ApplicationSharedPtr application));
+ MOCK_METHOD1(SetupDefaultHMILevel,
+ bool(application_manager::ApplicationSharedPtr application));
+ MOCK_METHOD1(StartAppHmiStateResumption,
+ void(application_manager::ApplicationSharedPtr application));
+ MOCK_METHOD3(SetAppHMIState,
+ bool(application_manager::ApplicationSharedPtr application,
+ const mobile_apis::HMILevel::eType hmi_level,
+ bool check_policy));
+ MOCK_CONST_METHOD0(LaunchTime, time_t());
+
+#ifdef BUILD_TESTS
+ MOCK_METHOD1(set_resumption_storage,
+ void(utils::SharedPtr<resumption::ResumptionData> mock_storage));
+#endif // BUILD_TESTS
+};
+
+} // namespace resumprion_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUME_CTRL_H_
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..7b16a3bf00 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:
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..d115ad8b40 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
@@ -53,7 +48,7 @@ set(LIBRARIES
)
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..94ab511dc4 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);
@@ -146,7 +153,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 +207,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 +248,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 +289,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 +304,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 +350,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 +389,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);
@@ -699,7 +706,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 +725,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 +741,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 +759,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 +772,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 +785,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 +832,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 +850,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 +867,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 +928,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 +938,93 @@ 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
+} // 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..07b523c56e 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;
@@ -54,6 +55,8 @@ using protocol_handler::PROTOCOL_HEADER_V2_SIZE;
using application_manager::MobileMessageHandler;
using application_manager::ProtocolVersion;
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,15 +160,16 @@ 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,
+ application_manager::BinaryData* data = NULL) {
MobileMessage message = utils::MakeShared<Message>(
MessagePriority::FromServiceType(ServiceType::kRpc));
message->set_function_id(function_id);
@@ -173,7 +177,7 @@ class MobileMessageHandlerTest : public testing::Test {
message->set_connection_key(connection_key);
message->set_protocol_version(
static_cast<ProtocolVersion>(protocol_version));
- message->set_message_type(MessageType::kNotification);
+ 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,7 +256,8 @@ 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;
+ application_manager::BinaryData* binary_data =
+ new application_manager::BinaryData;
binary_data->push_back('X');
message->set_binary_data(binary_data);
EXPECT_TRUE(message->has_binary_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..f5a6e7833d 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,8 +107,9 @@ 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_json_message(data_json);
@@ -122,5 +125,6 @@ TEST(MobileMessageHandlerTestV1Test,
ptr->protocol_version());
}
+} // namespace application_manager_test
+} // namespace components
} // namespace test
-} // namespace 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 c53927d3a4..01ce9cb066 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -68,6 +68,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 +121,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 +173,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,7 +213,7 @@ 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(
@@ -269,6 +286,14 @@ smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
app);
}
+mobile_apis::Result::eType MessageHelper::VerifyImage(
+ smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->VerifyImage(
+ message, app, app_mngr);
+}
+
mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
@@ -276,6 +301,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
return MockMessageHelper::message_helper_mock()->VerifyImageFiles(
message, app, app_mngr);
}
+
std::string MessageHelper::CommonLanguageToString(
hmi_apis::Common_Language::eType lang) {
return MockMessageHelper::message_helper_mock()->CommonLanguageToString(lang);
@@ -306,4 +332,145 @@ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
reason);
}
+mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
+ smart_objects::SmartObject& message_params,
+ ApplicationConstSharedPtr app,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->ProcessSoftButtons(
+ message_params, app, policy_handler, app_mngr);
+}
+
+void MessageHelper::SubscribeApplicationToSoftButton(
+ smart_objects::SmartObject& message_params,
+ ApplicationSharedPtr app,
+ int32_t function_id) {
+ return MockMessageHelper::message_helper_mock()
+ ->SubscribeApplicationToSoftButton(message_params, app, function_id);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
+ uint32_t connection_key,
+ int32_t function_id,
+ const uint32_t correlation_id,
+ int32_t result_code) {
+ return MockMessageHelper::message_helper_mock()->CreateNegativeResponse(
+ connection_key, function_id, correlation_id, result_code);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
+ mobile_apis::FunctionID::eType function_id,
+ mobile_apis::Result::eType result,
+ const uint32_t correlation_id,
+ uint32_t connection_key) {
+ return MockMessageHelper::message_helper_mock()
+ ->CreateBlockedByPoliciesResponse(
+ function_id, result, correlation_id, connection_key);
+}
+
+const VehicleData& MessageHelper::vehicle_data() {
+ return MockMessageHelper::message_helper_mock()->vehicle_data();
+}
+
+bool MessageHelper::SendStopAudioPathThru(ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendStopAudioPathThru(
+ app_mngr);
+}
+
+std::string MessageHelper::StringifiedFunctionID(
+ const mobile_apis::FunctionID::eType function_id) {
+ return MockMessageHelper::message_helper_mock()->StringifiedFunctionID(
+ function_id);
+}
+
+void MessageHelper::SendUIChangeRegistrationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()
+ ->SendUIChangeRegistrationRequestToHMI(app, app_mngr);
+}
+
+bool MessageHelper::CreateHMIApplicationStruct(
+ ApplicationConstSharedPtr app,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ smart_objects::SmartObject* output,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->CreateHMIApplicationStruct(
+ app, session_observer, policy_handler, output, app_mngr);
+}
+
+void MessageHelper::SendOnAppUnregNotificationToHMI(
+ ApplicationConstSharedPtr app,
+ const bool is_unexpected_disconnect,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendOnAppUnregNotificationToHMI(
+ app, is_unexpected_disconnect, app_mngr);
+}
+
+void MessageHelper::SendLaunchApp(const uint32_t connection_key,
+ const std::string& urlSchema,
+ const std::string& packageName,
+ ApplicationManager& app_man) {
+ MockMessageHelper::message_helper_mock()->SendLaunchApp(
+ connection_key, urlSchema, packageName, app_man);
+}
+
+bool MessageHelper::SendUnsubscribedWayPoints(ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendUnsubscribedWayPoints(
+ app_mngr);
+}
+
+void MessageHelper::SendQueryApps(const uint32_t connection_key,
+ ApplicationManager& app_man) {
+ MockMessageHelper::message_helper_mock()->SendQueryApps(connection_key,
+ app_man);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateAppVrHelp(
+ ApplicationConstSharedPtr app) {
+ return MockMessageHelper::message_helper_mock()->CreateAppVrHelp(app);
+}
+
+mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
+ smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->VerifyImageVrHelpItems(
+ message, app, app_mngr);
+}
+
+const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) {
+ return MockMessageHelper::message_helper_mock()->GetPriorityCode(priority);
+}
+
+void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app,
+ const bool default_help_prompt,
+ ApplicationManager& app_man) {
+ MockMessageHelper::message_helper_mock()->SendTTSGlobalProperties(
+ app, default_help_prompt, app_man);
+}
+
+bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
+ return MockMessageHelper::message_helper_mock()->PrintSmartObject(object);
+}
+
+void MessageHelper::SendSetAppIcon(const uint32_t app_id,
+ const std::string& icon_path,
+ ApplicationManager& application_manager) {
+ MockMessageHelper::message_helper_mock()->SendSetAppIcon(
+ app_id, icon_path, application_manager);
+}
+
+std::string MessageHelper::StringifiedHMILevel(
+ const mobile_apis::HMILevel::eType hmi_level) {
+ return MockMessageHelper::message_helper_mock()->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);
+}
+
} // 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..9713989f81 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,14 +218,85 @@ 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
EXPECT_CALL(policy_settings_, enable_policy()).WillRepeatedly(Return(false));
@@ -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,42 @@ 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(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 +821,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 +891,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 +903,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 +921,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 +941,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 +965,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 +987,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 +1009,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 +1039,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 +1064,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 +1099,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 +1132,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);
}
@@ -930,8 +1205,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 +1226,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 +1289,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 +1301,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 +1309,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 +1340,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 +1447,138 @@ 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(_, _, _, _, _));
- 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(*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(_, _, _, _, _));
+
+#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);
+}
+
+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(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(std::string()));
+ EXPECT_CALL(mock_session_observer, GetDataOnDeviceID(_, _, _, _, _));
+
+#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);
}
TEST_F(PolicyHandlerTest, RetrieveCertificate) {
@@ -1218,87 +1594,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);
+
+ 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 EXTENDED_POLICY
+#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 +1806,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 +1852,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 +1866,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,8 +1874,10 @@ 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_app_, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
EXPECT_CALL(mock_session_observer, GetDataOnDeviceID(_, _, _, _, _))
.WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
@@ -1446,7 +1889,112 @@ 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(_, _, _, _, _))
+ .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, 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(_, _, _, _, _))
+ .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) {
@@ -1455,24 +2003,440 @@ TEST_F(PolicyHandlerTest, SendMessageToSDK) {
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(*MockMessageHelper::message_helper_mock(),
- SendPolicySnapshotNotification(kAppId_, msg, url, _));
// Act
+ policy_handler_.last_used_app_ids().push_back(kAppId1_);
+ EXPECT_CALL(mock_message_helper_,
+ SendPolicySnapshotNotification(kAppId1_, msg, url, _));
EXPECT_TRUE(policy_handler_.SendMessageToSDK(msg, url));
}
+TEST_F(PolicyHandlerTest, SendMessageToSDK_InavalidApp_UNSUCCESS) {
+ BinaryMessage msg;
+ const std::string url = "test_url";
+ EnablePolicyAndPolicyManagerMock();
+ utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ policy_handler_.last_used_app_ids().push_back(kAppId1_);
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(*mock_app_, policy_app_id()).Times(0);
+
+ 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(_, _, _, _, _))
+ .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(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(_, _, 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(_, _, 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/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 9857072674..f80842e250 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
@@ -30,10 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/resumption/resume_ctrl.h"
#include <string>
#include <algorithm>
+
#include "gtest/gtest.h"
+#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/usage_statistics.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_resumption_data.h"
@@ -60,6 +61,7 @@ using ::testing::SetArgReferee;
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::AtLeast;
+using ::testing::Eq;
using namespace application_manager_test;
using namespace resumption;
@@ -76,17 +78,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<ResumeCtrl>(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_));
@@ -98,12 +104,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_;
@@ -111,20 +120,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_;
};
/**
@@ -138,15 +149,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);
}
@@ -162,15 +174,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);
}
@@ -209,14 +222,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,
@@ -224,7 +238,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);
}
@@ -246,15 +260,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;
@@ -264,8 +279,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);
}
@@ -286,16 +301,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;
@@ -303,7 +319,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);
}
@@ -337,16 +353,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;
@@ -354,7 +371,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);
}
@@ -368,21 +385,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);
}
@@ -406,25 +424,26 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
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);
}
@@ -450,17 +469,18 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
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,
+ *app_mock_,
SubscribeToIVI(static_cast<application_manager::VehicleDataType>(i)));
}
@@ -468,20 +488,44 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
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(_));
+ 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);
}
@@ -495,15 +539,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) {
@@ -516,10 +562,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_);
}
/**
@@ -537,14 +584,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);
}
@@ -553,18 +601,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_);
}
/**
@@ -576,10 +652,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);
}
@@ -588,10 +665,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);
}
@@ -599,14 +676,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);
}
@@ -614,14 +691,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);
}
@@ -629,78 +706,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) {
@@ -710,10 +833,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) {
@@ -726,14 +850,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) {
@@ -746,16 +871,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_, OnSuspend());
+ 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_, OnSuspend());
+ EXPECT_CALL(*mock_storage_, Persist());
+ res_ctrl_->OnSuspend();
}
TEST_F(ResumeCtrlTest, OnAwake) {
@@ -763,15 +906,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_, OnAwake());
+ 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_) {
@@ -779,9 +923,33 @@ 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) {
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(Return(false));
+ EXPECT_EQ(mobile_apis::HMILevel::INVALID_ENUM,
+ res_ctrl_->GetSavedAppHmiLevel(kTestPolicyAppId_, kMacAddress_));
+}
+
+ACTION_P(SetHmiLevel, hmi_level) {
+ arg2[am::strings::hmi_level] = hmi_level;
+}
+
+TEST_F(ResumeCtrlTest, GetSavedAppHmiLevel_AskedAppFound_INVALID_ENUM) {
+ const mobile_apis::HMILevel::eType hmi_level =
+ mobile_apis::HMILevel::HMI_FULL;
+
+ 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..aa4db59eac 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"
@@ -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) &&
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..834637fa62 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;
};
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..79397f5175 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"
diff --git a/src/components/application_manager/test/smartDeviceLink_test.ini b/src/components/application_manager/test/smartDeviceLink_test.ini
index c544a6e02d..48f4d2c808 100644
--- a/src/components/application_manager/test/smartDeviceLink_test.ini
+++ b/src/components/application_manager/test/smartDeviceLink_test.ini
@@ -37,3 +37,19 @@ AttemptsToOpenResumptionDB = 5
# Timeout between attempts during opening DB in milliseconds
OpenAttemptTimeoutMsResumptionDB = 500
+
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true
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..eb718c8b8b 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,
@@ -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 uint32_t app_id) {
+ am::HmiStatePtr new_state =
+ utils::MakeShared<HmiStateType>(app_id, 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(),
@@ -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);
@@ -2372,7 +2460,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 +2478,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 +2566,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,
+ app_id);
+
+ 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,
+ app_id);
+
+ 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,
+ app_id);
+
+ 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,
+ app_id);
+ 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 5abf8a9f78..42b0d10ceb 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -137,7 +137,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
@@ -271,13 +271,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
* @brief Returns timeout for SDL to wait for the next package of raw data
* over audio service
*/
- const std::uint32_t audio_data_stopped_timeout() const;
+ const uint32_t audio_data_stopped_timeout() const;
/**
* @brief Returns timeout for SDL to wait for the next package of raw data
* over video service
*/
- const std::uint32_t video_data_stopped_timeout() const;
+ const uint32_t video_data_stopped_timeout() const;
/**
* @brief Returns allowable max amount of requests per time scale for
@@ -560,7 +560,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint32_t resumption_delay_before_ign() const;
- uint32_t resumption_delay_after_ign() const;
+ const uint32_t resumption_delay_after_ign() const;
uint32_t hash_string_size() const;
@@ -582,11 +582,56 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
uint16_t open_attempt_timeout_ms_resumption_db() const;
- /*
+ /**
+ * @brief Returns wait time after device connection
+ * before app launch request
+ */
+ const uint16_t app_launch_wait_time() const OVERRIDE;
+
+ /**
+ * @brief Returns max number of attempts to launch an application
+ * after device connection
+ */
+ const uint16_t app_launch_max_retry_attempt() const OVERRIDE;
+
+ /**
+ * @brief Returns wait time before next app launch request
+ */
+ const uint16_t app_launch_retry_wait_time() const OVERRIDE;
+
+ /**
+ * @brief Returns max number of failed iOS app
+ * registration requests
+ */
+ const uint16_t remove_bundle_id_attempts() const OVERRIDE;
+
+ /**
+ * @brief Returns max number of iOS devices to be stored
+ */
+ const uint16_t max_number_of_ios_device() const OVERRIDE;
+
+ /**
+ * @brief Returns wait time before attempt to launch next app
+ */
+ const uint16_t wait_time_between_apps() const OVERRIDE;
+
+ /**
+ * @brief Returns status of feature of app launch on iOS
+ */
+ const bool enable_app_launch_ios() 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;
@@ -599,8 +644,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
*
@@ -752,8 +810,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string system_files_path_;
uint16_t transport_manager_tcp_adapter_port_;
std::string tts_delimiter_;
- std::uint32_t audio_data_stopped_timeout_;
- std::uint32_t video_data_stopped_timeout_;
+ uint32_t audio_data_stopped_timeout_;
+ uint32_t video_data_stopped_timeout_;
std::string mme_db_name_;
std::string event_mq_name_;
std::string ack_mq_name_;
@@ -810,6 +868,15 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
bool use_db_for_resumption_;
uint16_t attempts_to_open_resumption_db_;
uint16_t open_attempt_timeout_ms_resumption_db_;
+ uint16_t app_launch_wait_time_;
+ uint16_t app_launch_max_retry_attempt_;
+ uint16_t app_launch_retry_wait_time_;
+ uint16_t remove_bundle_id_attempts_;
+ uint16_t max_number_of_ios_device_;
+ uint16_t wait_time_between_apps_;
+ bool enable_app_launch_ios_;
+ bool error_occured_;
+ std::string error_description_;
DISALLOW_COPY_AND_ASSIGN(Profile);
};
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index b5ea924b49..beabc6afa8 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"
@@ -84,6 +86,7 @@ const char* kIAPSection = "IAP";
const char* kProtocolHandlerSection = "ProtocolHandler";
const char* kSDL4Section = "SDL4";
const char* kResumptionSection = "Resumption";
+const char* kAppLaunchSection = "AppLaunch";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -102,7 +105,6 @@ const char* kAppIconsFolderKey = "AppIconsFolder";
const char* kAppIconsFolderMaxSizeKey = "AppIconsFolderMaxSize";
const char* kAppIconsAmountToRemoveKey = "AppIconsAmountToRemove";
const char* kLaunchHMIKey = "LaunchHMI";
-
const char* kDefaultSDLVersion = "";
#ifdef WEB_HMI
const char* kLinkToWebHMI = "LinkToWebHMI";
@@ -197,6 +199,13 @@ const char* kAttemptsToOpenResumptionDBKey = "AttemptsToOpenResumptionDB";
const char* kOpenAttemptTimeoutMsResumptionDBKey =
"OpenAttemptTimeoutMsResumptionDB";
+const char* kAppLaunchWaitTimeKey = "AppLaunchWaitTime";
+const char* kAppLaunchMaxRetryAttemptKey = "AppLaunchMaxRetryAttempt";
+const char* kAppLaunchRetryWaitTimeKey = "AppLaunchRetryWaitTime";
+const char* kRemoveBundleIDattemptsKey = "RemoveBundleIDattempts";
+const char* kMaxNumberOfiOSDeviceKey = "MaxNumberOfiOSDevice";
+const char* kWaitTimeBetweenAppsKey = "WaitTimeBetweenApps";
+const char* kEnableAppLaunchIOSKey = "EnableAppLaunchIOS";
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
#endif // WEB_HMI
@@ -278,6 +287,15 @@ const uint32_t kDefaultAppIconsFolderMaxSize = 104857600;
const uint32_t kDefaultAppIconsAmountToRemove = 1;
const uint16_t kDefaultAttemptsToOpenResumptionDB = 5;
const uint16_t kDefaultOpenAttemptTimeoutMsResumptionDB = 500;
+const uint16_t kDefaultAppLaunchWaitTime = 5000;
+const uint16_t kDefaultAppLaunchMaxRetryAttempt = 3;
+const uint16_t kDefaultAppLaunchRetryWaitTime = 15000;
+const uint16_t kDefaultRemoveBundleIDattempts = 3;
+const uint16_t kDefaultMaxNumberOfiOSDevice = 10;
+const uint16_t kDefaultWaitTimeBetweenApps = 4000;
+const bool kDefaultEnableAppLaunchIOS = true;
+const std::string kAllowedSymbols =
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
} // namespace
namespace profile {
@@ -366,14 +384,26 @@ Profile::Profile()
, use_db_for_resumption_(false)
, attempts_to_open_resumption_db_(kDefaultAttemptsToOpenResumptionDB)
, open_attempt_timeout_ms_resumption_db_(
- kDefaultOpenAttemptTimeoutMsResumptionDB) {
+ kDefaultOpenAttemptTimeoutMsResumptionDB)
+ , app_launch_wait_time_(kDefaultAppLaunchWaitTime)
+ , app_launch_max_retry_attempt_(kDefaultAppLaunchMaxRetryAttempt)
+ , app_launch_retry_wait_time_(kDefaultAppLaunchRetryWaitTime)
+ , remove_bundle_id_attempts_(kDefaultRemoveBundleIDattempts)
+ , max_number_of_ios_device_(kDefaultMaxNumberOfiOSDevice)
+ , wait_time_between_apps_(kDefaultWaitTimeBetweenApps)
+ , enable_app_launch_ios_(kDefaultEnableAppLaunchIOS)
+ , error_occured_(false)
+ , error_description_() {
+ // SDL version
+ ReadStringValue(
+ &sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey);
}
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();
}
}
@@ -532,11 +562,11 @@ const std::string& Profile::audio_stream_file() const {
return audio_stream_file_;
}
-const std::uint32_t Profile::audio_data_stopped_timeout() const {
+const uint32_t Profile::audio_data_stopped_timeout() const {
return audio_data_stopped_timeout_;
}
-const std::uint32_t Profile::video_data_stopped_timeout() const {
+const uint32_t Profile::video_data_stopped_timeout() const {
return video_data_stopped_timeout_;
}
@@ -758,7 +788,7 @@ uint32_t Profile::resumption_delay_before_ign() const {
return resumption_delay_before_ign_;
}
-uint32_t Profile::resumption_delay_after_ign() const {
+const uint32_t Profile::resumption_delay_after_ign() const {
return resumption_delay_after_ign_;
}
@@ -829,6 +859,49 @@ uint16_t Profile::open_attempt_timeout_ms_resumption_db() const {
return open_attempt_timeout_ms_resumption_db_;
}
+const uint16_t Profile::app_launch_max_retry_attempt() const {
+ return app_launch_max_retry_attempt_;
+}
+
+const uint16_t Profile::app_launch_retry_wait_time() const {
+ return app_launch_retry_wait_time_;
+}
+
+const uint16_t Profile::app_launch_wait_time() const {
+ return app_launch_wait_time_;
+}
+
+const bool Profile::enable_app_launch_ios() const {
+ return enable_app_launch_ios_;
+}
+
+const uint16_t Profile::max_number_of_ios_device() const {
+ return max_number_of_ios_device_;
+}
+
+const uint16_t Profile::remove_bundle_id_attempts() const {
+ return remove_bundle_id_attempts_;
+}
+
+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_);
@@ -1522,6 +1595,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,
@@ -1687,6 +1765,66 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(open_attempt_timeout_ms_resumption_db_,
kOpenAttemptTimeoutMsResumptionDBKey,
kResumptionSection);
+
+ // Read parameters from App Launch section
+ ReadUIntValue(&app_launch_wait_time_,
+ kDefaultAppLaunchWaitTime,
+ kAppLaunchSection,
+ kAppLaunchWaitTimeKey);
+
+ LOG_UPDATED_VALUE(
+ app_launch_wait_time_, kAppLaunchWaitTimeKey, kAppLaunchSection);
+
+ ReadUIntValue(&app_launch_max_retry_attempt_,
+ kDefaultAppLaunchMaxRetryAttempt,
+ kAppLaunchSection,
+ kAppLaunchMaxRetryAttemptKey);
+
+ LOG_UPDATED_VALUE(app_launch_max_retry_attempt_,
+ kAppLaunchMaxRetryAttemptKey,
+ kAppLaunchSection);
+
+ ReadUIntValue(&app_launch_retry_wait_time_,
+ kDefaultAppLaunchRetryWaitTime,
+ kAppLaunchSection,
+ kAppLaunchRetryWaitTimeKey);
+
+ LOG_UPDATED_VALUE(app_launch_retry_wait_time_,
+ kAppLaunchRetryWaitTimeKey,
+ kAppLaunchSection);
+
+ ReadUIntValue(&remove_bundle_id_attempts_,
+ kDefaultRemoveBundleIDattempts,
+ kAppLaunchSection,
+ kRemoveBundleIDattemptsKey);
+
+ LOG_UPDATED_VALUE(remove_bundle_id_attempts_,
+ kRemoveBundleIDattemptsKey,
+ kAppLaunchSection);
+
+ ReadUIntValue(&max_number_of_ios_device_,
+ kDefaultMaxNumberOfiOSDevice,
+ kAppLaunchSection,
+ kMaxNumberOfiOSDeviceKey);
+
+ LOG_UPDATED_VALUE(
+ max_number_of_ios_device_, kMaxNumberOfiOSDeviceKey, kAppLaunchSection);
+
+ ReadUIntValue(&wait_time_between_apps_,
+ kDefaultWaitTimeBetweenApps,
+ kAppLaunchSection,
+ kWaitTimeBetweenAppsKey);
+
+ LOG_UPDATED_VALUE(
+ wait_time_between_apps_, kWaitTimeBetweenAppsKey, kAppLaunchSection);
+
+ ReadBoolValue(&enable_app_launch_ios_,
+ kDefaultEnableAppLaunchIOS,
+ kAppLaunchSection,
+ kEnableAppLaunchIOSKey);
+
+ LOG_UPDATED_BOOL_VALUE(
+ enable_app_launch_ios_, kEnableAppLaunchIOSKey, kAppLaunchSection);
}
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/config_profile/test/smartDeviceLink.ini b/src/components/config_profile/test/smartDeviceLink.ini
index 41dabaa530..6ea131b095 100644
--- a/src/components/config_profile/test/smartDeviceLink.ini
+++ b/src/components/config_profile/test/smartDeviceLink.ini
@@ -183,3 +183,19 @@ ResumptionDelayBeforeIgn = 30;
# Timeout in seconds to restore hmi_level for media app after sdl run
ResumptionDelayAfterIgn = 30;
+
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true
diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini b/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini
index 560fb5117a..f93fa39597 100644
--- a/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini
+++ b/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini
@@ -183,3 +183,19 @@ ResumptionDelayBeforeIgn = 30;
# Timeout in seconds to restore hmi_level for media app after sdl run
ResumptionDelayAfterIgn = 30;
+
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true \ No newline at end of file
diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_int.ini b/src/components/config_profile/test/smartDeviceLink_invalid_int.ini
index 76bcc5a0f0..9c88a8950c 100644
--- a/src/components/config_profile/test/smartDeviceLink_invalid_int.ini
+++ b/src/components/config_profile/test/smartDeviceLink_invalid_int.ini
@@ -185,3 +185,19 @@ ResumptionDelayBeforeIgn = 30;
# Timeout in seconds to restore hmi_level for media app after sdl run
ResumptionDelayAfterIgn = 30;
+
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true \ No newline at end of file
diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini b/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini
index 1507b2a84c..b389b0b492 100644
--- a/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini
+++ b/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini
@@ -185,3 +185,19 @@ ResumptionDelayBeforeIgn = 30;
# Timeout in seconds to restore hmi_level for media app after sdl run
ResumptionDelayAfterIgn = 30;
+
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true \ No newline at end of file
diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_string.ini b/src/components/config_profile/test/smartDeviceLink_invalid_string.ini
index 6669b580c5..f18b43cb41 100644
--- a/src/components/config_profile/test/smartDeviceLink_invalid_string.ini
+++ b/src/components/config_profile/test/smartDeviceLink_invalid_string.ini
@@ -188,3 +188,19 @@ ResumptionDelayBeforeIgn = 30;
# Timeout in seconds to restore hmi_level for media app after sdl run
ResumptionDelayAfterIgn = 30;
+
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true \ No newline at end of file
diff --git a/src/components/config_profile/test/smartDeviceLink_test.ini b/src/components/config_profile/test/smartDeviceLink_test.ini
index 6e2943b569..9791544e16 100644
--- a/src/components/config_profile/test/smartDeviceLink_test.ini
+++ b/src/components/config_profile/test/smartDeviceLink_test.ini
@@ -190,3 +190,19 @@ ResumptionDelayBeforeIgn = 30;
# Timeout in seconds to restore hmi_level for media app after sdl run
ResumptionDelayAfterIgn = 30;
+
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true
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_handler.h b/src/components/connection_handler/include/connection_handler/connection_handler.h
deleted file mode 100644
index cb22b87bbb..0000000000
--- a/src/components/connection_handler/include/connection_handler/connection_handler.h
+++ /dev/null
@@ -1,197 +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_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;
-
- 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 d061e55491..cd8aec0ff3 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
@@ -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
@@ -102,6 +102,18 @@ class ConnectionHandlerImpl
*/
void ConnectToDevice(connection_handler::DeviceHandle device_handle) OVERRIDE;
+ /**
+ * @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.
+ */
+ void RunAppOnDevice(const std::string& device_mac,
+ const std::string& bundle_id) const OVERRIDE;
+
void ConnectToAllDevices() OVERRIDE;
void StartTransportManager() OVERRIDE;
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/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_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index d8c05e6e6e..0f6720f6a1 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -173,6 +173,7 @@ void ConnectionHandlerImpl::OnDeviceRemoved(
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_);
}
}
@@ -697,6 +698,20 @@ void ConnectionHandlerImpl::ConnectToDevice(
}
}
+void ConnectionHandlerImpl::RunAppOnDevice(const std::string& device_mac,
+ const std::string& bundle_id) const {
+ for (DeviceMap::const_iterator i = device_list_.begin();
+ i != device_list_.end();
+ ++i) {
+ const connection_handler::Device& device = i->second;
+ if (device.mac_address() == device_mac) {
+ transport_manager_.RunAppOnDevice(device.device_handle(), bundle_id);
+ return;
+ }
+ }
+ LOG4CXX_WARN(logger_, "No apps found on device " << device_mac);
+}
+
void ConnectionHandlerImpl::ConnectToAllDevices() {
for (DeviceMap::iterator i = device_list_.begin(); i != device_list_.end();
++i) {
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 3a8aaa70b4..6b5c2c89ad 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 {
@@ -58,6 +59,10 @@ using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRefOfCopy;
+namespace {
+const uint32_t kAsyncExpectationsTimeout = 10000u;
+}
+
// For service types and PROTECTION_ON/OFF
enum UnnamedService { kServedService1 = 0x06, kServedService2 = 0x08 };
@@ -65,8 +70,14 @@ enum UnnamedService { kServedService1 = 0x06, kServedService2 = 0x08 };
class ConnectionHandlerTest : public ::testing::Test {
protected:
void SetUp() OVERRIDE {
+ device_handle_ = 0;
+
+ connection_type_ = "BTMAC";
+ device_name_ = "test_name";
+ mac_address_ = "test_address";
+
connection_handler_ = new ConnectionHandlerImpl(
- mock_connection_handler_settings, mock_transport_manager);
+ mock_connection_handler_settings, mock_transport_manager_);
uid_ = 1u;
connection_key_ = connection_handler_->KeyFromPair(0, 0u);
protected_services_.clear();
@@ -87,12 +98,6 @@ class ConnectionHandlerTest : public ::testing::Test {
}
// Additional SetUp
void AddTestDeviceConnection() {
- device_handle_ = 0;
-
- connection_type_ = "BTMAC";
- device_name_ = "test_name";
- mac_address_ = "test_address";
-
const transport_manager::DeviceInfo device_info(
device_handle_, mac_address_, device_name_, connection_type_);
// Add Device and connection
@@ -239,7 +244,7 @@ class ConnectionHandlerTest : public ::testing::Test {
ConnectionHandlerImpl* connection_handler_;
testing::NiceMock<transport_manager_test::MockTransportManager>
- mock_transport_manager;
+ mock_transport_manager_;
testing::NiceMock<MockConnectionHandlerSettings>
mock_connection_handler_settings;
protocol_handler_test::MockProtocolHandler mock_protocol_handler_;
@@ -448,7 +453,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 +463,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 +471,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 +485,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,7 +511,7 @@ 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);
@@ -534,7 +539,7 @@ 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);
@@ -558,12 +563,12 @@ 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);
- EXPECT_CALL(mock_transport_manager, SearchDevices());
+ EXPECT_CALL(mock_transport_manager_, SearchDevices());
EXPECT_CALL(mock_connection_handler_observer, OnDeviceListUpdated(_));
connection_handler_->StartDevicesDiscovery();
}
@@ -599,7 +604,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);
@@ -662,7 +667,7 @@ TEST_F(ConnectionHandlerTest, StartTransportManager) {
AddTestDeviceConnection();
AddTestSession();
- EXPECT_CALL(mock_transport_manager, Visibility(true));
+ EXPECT_CALL(mock_transport_manager_, Visibility(true));
connection_handler_->StartTransportManager();
}
@@ -678,7 +683,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 +702,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 +720,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 +737,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);
@@ -759,9 +764,9 @@ TEST_F(ConnectionHandlerTest, ConnectToDevice) {
connection_handler_->OnDeviceAdded(device1);
connection_handler_->OnDeviceAdded(device2);
- EXPECT_CALL(mock_transport_manager, ConnectDevice(dev_handle1))
+ EXPECT_CALL(mock_transport_manager_, ConnectDevice(dev_handle1))
.WillOnce(Return(transport_manager::E_SUCCESS));
- EXPECT_CALL(mock_transport_manager, ConnectDevice(dev_handle2)).Times(0);
+ EXPECT_CALL(mock_transport_manager_, ConnectDevice(dev_handle2)).Times(0);
connection_handler_->ConnectToDevice(dev_handle1);
}
@@ -777,9 +782,9 @@ TEST_F(ConnectionHandlerTest, ConnectToAllDevices) {
connection_handler_->OnDeviceAdded(device1);
connection_handler_->OnDeviceAdded(device2);
- EXPECT_CALL(mock_transport_manager, ConnectDevice(dev_handle1))
+ EXPECT_CALL(mock_transport_manager_, ConnectDevice(dev_handle1))
.WillOnce(Return(transport_manager::E_SUCCESS));
- EXPECT_CALL(mock_transport_manager, ConnectDevice(dev_handle2))
+ EXPECT_CALL(mock_transport_manager_, ConnectDevice(dev_handle2))
.WillOnce(Return(transport_manager::E_SUCCESS));
connection_handler_->ConnectToAllDevices();
}
@@ -788,7 +793,7 @@ TEST_F(ConnectionHandlerTest, CloseConnection) {
AddTestDeviceConnection();
AddTestSession();
- EXPECT_CALL(mock_transport_manager, DisconnectForce(uid_));
+ EXPECT_CALL(mock_transport_manager_, DisconnectForce(uid_));
connection_handler_->CloseConnection(uid_);
}
@@ -796,7 +801,7 @@ TEST_F(ConnectionHandlerTest, CloseRevokedConnection) {
AddTestDeviceConnection();
AddTestSession();
- EXPECT_CALL(mock_transport_manager, DisconnectForce(uid_));
+ EXPECT_CALL(mock_transport_manager_, DisconnectForce(uid_));
connection_handler_->CloseRevokedConnection(connection_key_);
}
@@ -805,27 +810,40 @@ 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_);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(1);
+ .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 +851,40 @@ 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_);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(1);
+ .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 +892,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_);
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
.Times(0);
+
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kMalformed))
- .Times(1);
+ .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 +932,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_);
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
.Times(0);
+
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kMalformed))
- .Times(1);
+ .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,28 +972,40 @@ 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_);
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(1);
+ .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) {
@@ -1051,7 +1112,7 @@ TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) {
// Add virtual device and connection
AddTestDeviceConnection();
// 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);
@@ -1428,6 +1489,40 @@ TEST_F(ConnectionHandlerTest, SendHeartBeat) {
connection_handler_->SendHeartBeat(uid_, start_session_id_);
}
+TEST_F(ConnectionHandlerTest, RunAppOnDevice_NoAppOnDevice_UNSUCCESS) {
+ const std::string bundle_id = "test_bundle_id";
+ const std::string mac_address0 = "test_mac_address0";
+ // All MAC addresses were stored in device list of ConnectionHandler in form
+ // of hashed string.
+ const std::string hash_of_mac_address0 = encryption::MakeHash(mac_address0);
+ const std::string hash_of_mac_address1 =
+ encryption::MakeHash("test_mac_address1");
+
+ // By default device list of ConnectionHandler was empty.
+ EXPECT_CALL(mock_transport_manager_, RunAppOnDevice(_, _)).Times(0);
+ connection_handler_->RunAppOnDevice(hash_of_mac_address0, bundle_id);
+
+ transport_manager::DeviceInfo device_info(
+ device_handle_, mac_address0, device_name_, connection_type_);
+ connection_handler_->OnDeviceAdded(device_info);
+
+ connection_handler_->RunAppOnDevice(hash_of_mac_address1, bundle_id);
+}
+
+TEST_F(ConnectionHandlerTest, RunAppOnDevice_AppOnDevice_SUCCESS) {
+ const std::string bundle_id = "test_bundle_id";
+
+ transport_manager::DeviceInfo device_info(
+ device_handle_, mac_address_, device_name_, connection_type_);
+ connection_handler_->OnDeviceAdded(device_info);
+
+ const std::string hash_of_mac_address = encryption::MakeHash(mac_address_);
+
+ EXPECT_CALL(mock_transport_manager_,
+ RunAppOnDevice(device_handle_, bundle_id));
+ connection_handler_->RunAppOnDevice(hash_of_mac_address, bundle_id);
+}
+
} // 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..85f43f3785 100644
--- a/src/components/connection_handler/test/connection_test.cc
+++ b/src/components/connection_handler/test/connection_test.cc
@@ -462,6 +462,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..211310d885 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
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/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 -L${DBUS_LIBS_DIRECTORY}
+)
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,14 @@ 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)
+add_dependecnies("DBus" Utils install-3rd_party_dbus)
target_link_libraries("DBus" "${LIBRARIES}")
diff --git a/src/components/dbus/include/dbus/dbus_adapter.h b/src/components/dbus/include/dbus/dbus_adapter.h
index 3877649e10..9c78c428ca 100644
--- a/src/components/dbus/include/dbus/dbus_adapter.h
+++ b/src/components/dbus/include/dbus/dbus_adapter.h
@@ -42,8 +42,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..973cc86fae 100644
--- a/src/components/dbus/include/dbus/dbus_message_controller.h
+++ b/src/components/dbus/include/dbus/dbus_message_controller.h
@@ -36,11 +36,10 @@
#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:
/**
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..d3f547a893 100644
--- a/src/components/dbus/src/dbus_adapter.cc
+++ b/src/components/dbus/src/dbus_adapter.cc
@@ -35,10 +35,10 @@
#include <sstream>
#include "formatters/CSmartFactory.hpp"
#include "utils/logger.h"
+#include "smart_objects/smart_object.h"
using ford_message_descriptions::ParameterDescription;
namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
extern char introspection_xml[];
diff --git a/src/components/dbus/test/CMakeLists.txt b/src/components/dbus/test/CMakeLists.txt
index d96f2388fb..1b3df2c0e7 100644
--- a/src/components/dbus/test/CMakeLists.txt
+++ b/src/components/dbus/test/CMakeLists.txt
@@ -28,13 +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}/dbus/include/
)
+#FIXME: exclude some tests
+set (EXCLUDE_PATHS
+ test_dbus_message_controller.cc
+)
+
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" ${EXCLUDE_PATHS})
+
set (LIBRARIES
gmock
DBus
@@ -42,12 +49,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/test_dbus_message_controller.cc b/src/components/dbus/test/dbus_message_controller_test.cc
index 5c5d4e69d5..5c5d4e69d5 100644
--- a/src/components/dbus/test/test_dbus_message_controller.cc
+++ b/src/components/dbus/test/dbus_message_controller_test.cc
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/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/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc
index c2b0d73394..fa368924c9 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 {
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..293f881c4a 100644
--- a/src/components/formatters/test/meta_formatter_test.cc
+++ b/src/components/formatters/test/meta_formatter_test.cc
@@ -138,6 +138,8 @@ TEST_F(CMetaFormatterTestHelper,
0, result_object[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"].asInt());
EXPECT_EQ(
0, result_object[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"].asInt());
+ EXPECT_EQ(
+ 0, result_object[S_MSG_PARAMS]["syncMsgVersion"]["patchVersion"].asInt());
// Uncomment code to print object in console
// std::string str;
diff --git a/src/components/formatters/test/src/create_smartSchema.cc b/src/components/formatters/test/src/create_smartSchema.cc
index 75663d4488..4ae692429c 100644
--- a/src/components/formatters/test/src/create_smartSchema.cc
+++ b/src/components/formatters/test/src/create_smartSchema.cc
@@ -338,6 +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),
@@ -355,6 +356,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..a29c1bceb3 100644
--- a/src/components/formatters/test/src/meta_formatter_test_helper.cc
+++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc
@@ -193,6 +193,7 @@ 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;
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
index aa10729458..c1dfca5e67 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/
@@ -46,30 +48,36 @@ include_directories (
${LOG4CXX_INCLUDE_DIRECTORY}
)
-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)
+ 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})
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_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..8b238b4aa8 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
@@ -106,6 +106,14 @@ 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:
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/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/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..00f5ad6be8 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");
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..1c774b9efe 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));
}
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 09bdd7e6d5..0000000000
--- a/src/components/hmi_message_handler/src/mqueue_adapter.cc
+++ /dev/null
@@ -1,144 +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_delegate_(NULL)
- , 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/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt
index 98e9fd5653..0d7ccd9ee1 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,31 @@ include_directories (
${COMPONENTS_DIR}/hmi_message_handler/test/include
)
+if (HMIADAPTER STREQUAL "messagebroker")
+ set (BROKER_LIBRARIES
+ message_broker_client
+ message_broker_server
+ )
+endif()
+
+set(EXCLUDE_PATHS)
+
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
-)
-
-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(NOT HMI_DBUS_API})
+ list (APPEND EXCLUDE_PATHS
+ mock_subscriber.cc
+ dbus_message_adapter_test.cc
)
endif()
-create_test("hmi_message_handler_test" "${SOURCES}" "${LIBRARIES}")
-endif()
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+
+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_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
index 06cca74ba9..09f20ed75d 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
@@ -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::_;
+
class HMIMessageHandlerImplTest : public ::testing::Test {
public:
HMIMessageHandlerImplTest()
@@ -53,7 +56,7 @@ 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;
@@ -63,10 +66,12 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
.WillByDefault(ReturnRef(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();
+ 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 +82,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 +103,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 +150,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
index eb449f7121..86ebf100bb 100644
--- 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
@@ -30,12 +30,16 @@
* 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_
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_
#include <pthread.h>
#include "hmi_message_handler/dbus_message_controller.h"
+namespace test {
+namespace components {
+namespace hmi_message_handler_test {
+
class MockDBusMessageController
: public ::hmi_message_handler::DBusMessageController {
public:
@@ -65,4 +69,8 @@ class MockDBusMessageController
}
};
-#endif // TEST_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_
+} // namespace hmi_message_handler_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_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
index 62ccafb19a..9e9074e70c 100644
--- 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_SUBSCRIBER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_SUBSCRIBER_H_
#include <string>
@@ -39,7 +39,7 @@ struct DBusConnection;
namespace test {
namespace components {
-namespace hmi_message_handler {
+namespace hmi_message_handler_test {
class MockSubscriber {
public:
@@ -55,8 +55,8 @@ class MockSubscriber {
DBusConnection* conn_;
};
-} // namespace hmi_message_handler
+} // namespace hmi_message_handler_test
} // namespace components
} // namespace test
-#endif // TEST_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_SUBSCRIBER_H_
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_SUBSCRIBER_H_
diff --git a/src/components/hmi_message_handler/test/mock_subscriber.cc b/src/components/hmi_message_handler/test/mock_subscriber.cc
index c52d47b008..0fc9110a1d 100644
--- a/src/components/hmi_message_handler/test/mock_subscriber.cc
+++ b/src/components/hmi_message_handler/test/mock_subscriber.cc
@@ -30,12 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <dbus/dbus.h>
-#include "include/mock_subscriber.h"
+#include "dbus/dbus.h"
+#include "hmi_message_handler/mock_subscriber.h"
namespace test {
namespace components {
-namespace hmi_message_handler {
+namespace hmi_message_handler_test {
MockSubscriber::MockSubscriber(const std::string& nameService,
const std::string& path)
@@ -47,7 +47,6 @@ 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)) {
@@ -65,10 +64,8 @@ bool MockSubscriber::Start() {
return true;
}
-void MockSubscriber::Send(const std::string& message) {
- // int a = message.length();
-}
+void MockSubscriber::Send(const std::string& message) {}
-} // namespace hmi_message_handler
+} // namespace hmi_message_handler_test
} // 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/app_launch_settings.h b/src/components/include/application_manager/app_launch_settings.h
new file mode 100644
index 0000000000..47daf2f87c
--- /dev/null
+++ b/src/components/include/application_manager/app_launch_settings.h
@@ -0,0 +1,22 @@
+#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_SETTINGS_H_
+
+#include <stdint.h>
+#include <string>
+namespace app_launch {
+class AppLaunchSettings {
+ public:
+ virtual const uint16_t app_launch_wait_time() const = 0;
+ virtual const uint16_t app_launch_max_retry_attempt() const = 0;
+ virtual const uint16_t app_launch_retry_wait_time() const = 0;
+ virtual const uint16_t remove_bundle_id_attempts() const = 0;
+ virtual const uint16_t max_number_of_ios_device() const = 0;
+ virtual const uint16_t wait_time_between_apps() const = 0;
+ virtual const bool enable_app_launch_ios() const = 0;
+ virtual const uint32_t resumption_delay_after_ign() const = 0;
+ virtual const std::string& app_storage_folder() const = 0;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_SETTINGS_H_
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..180be220cc
--- /dev/null
+++ b/src/components/include/application_manager/application_manager.h
@@ -0,0 +1,597 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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/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"
+#include "policy/policy_types.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;
+using policy::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 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 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 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;
+
+ 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_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 b429da88c2..fa01b34783 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -34,20 +34,21 @@
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_SETTINGS_H_
#include "application_manager/request_controller_settings.h"
+#include "application_manager/app_launch_settings.h"
#include <stdint.h>
#include <string>
namespace application_manager {
-class ApplicationManagerSettings : public RequestControlerSettings {
+class ApplicationManagerSettings : public RequestControlerSettings,
+ public app_launch::AppLaunchSettings {
public:
virtual const uint32_t video_data_stopped_timeout() const = 0;
- virtual const std::uint32_t audio_data_stopped_timeout() const = 0;
+ virtual const uint32_t audio_data_stopped_timeout() const = 0;
virtual const std::pair<uint32_t, int32_t>& read_did_frequency() const = 0;
virtual const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency()
const = 0;
virtual uint32_t hash_string_size() const = 0;
- virtual const std::string& app_storage_folder() const = 0;
virtual const uint32_t& app_dir_quota() const = 0;
virtual uint32_t stop_streaming_timeout() const = 0;
virtual uint32_t application_list_update_timeout() const = 0;
@@ -82,11 +83,10 @@ class ApplicationManagerSettings : public RequestControlerSettings {
virtual const uint32_t& app_resumption_save_persistent_data_timeout()
const = 0;
virtual uint32_t resumption_delay_before_ign() const = 0;
- virtual uint32_t resumption_delay_after_ign() const = 0;
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;
@@ -94,6 +94,7 @@ class ApplicationManagerSettings : public RequestControlerSettings {
virtual const uint32_t& app_icons_amount_to_remove() const = 0;
virtual const uint32_t& list_files_response_size() const = 0;
};
+
} // namespace application_manager
#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_SETTINGS_H_
diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h
new file mode 100644
index 0000000000..556620b644
--- /dev/null
+++ b/src/components/include/application_manager/hmi_capabilities.h
@@ -0,0 +1,442 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_HMI_CAPABILITIES_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
+
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "json/json.h"
+#include "utils/macro.h"
+#include "application_manager/hmi_language_handler.h"
+#include "smart_objects/smart_object.h"
+
+namespace resumption {
+class LastState;
+}
+
+namespace application_manager {
+class ApplicationManager;
+
+class HMICapabilities {
+ public:
+ /*
+ * @brief Class destructor
+ *
+ */
+ virtual ~HMICapabilities() {}
+
+ /**
+ * @brief return component which follows for correctness of
+ * languages
+ * @return HMI language handler
+ */
+ virtual HMILanguageHandler& get_hmi_language_handler() = 0;
+
+ /*
+ * @brief Checks is image type(Static/Dynamic) requested by
+ * Mobile Device is supported on current HMI.
+ * @param image_type recieved type of image from Enum.
+ * @return Bool true if supported
+ */
+ virtual bool VerifyImageType(const int32_t image_type) const = 0;
+
+ /**
+ * @brief Checks if all HMI capabilities received
+ *
+ * @return TRUE if all information received, otherwise FALSE
+ */
+ virtual bool is_vr_cooperating() const = 0;
+ virtual void set_is_vr_cooperating(const bool value) = 0;
+
+ virtual bool is_tts_cooperating() const = 0;
+ virtual void set_is_tts_cooperating(const bool value) = 0;
+
+ virtual bool is_ui_cooperating() const = 0;
+ virtual void set_is_ui_cooperating(const bool value) = 0;
+
+ virtual bool is_navi_cooperating() const = 0;
+ virtual void set_is_navi_cooperating(const bool value) = 0;
+
+ virtual bool is_ivi_cooperating() const = 0;
+ virtual void set_is_ivi_cooperating(const bool value) = 0;
+
+ /*
+ * @brief Interface used to store information about software version of the
+ *target
+ *
+ * @param ccpu_version Received system/hmi software version
+ */
+ virtual void set_ccpu_version(const std::string& ccpu_version) = 0;
+
+ /*
+ * @brief Returns software version of the target
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual const std::string& ccpu_version() const = 0;
+
+ /*
+ * @brief Retrieves if mixing audio is supported by HMI
+ * (ie recording TTS command and playing audio)
+ *
+ * @return Current state of the mixing audio flag
+ */
+ virtual bool attenuated_supported() const = 0;
+
+ /*
+ * @brief Sets state for mixing audio
+ *
+ * @param state New state to be set
+ */
+ virtual void set_attenuated_supported(const bool state) = 0;
+
+ /*
+ * @brief Retrieves currently active UI language
+ *
+ * @return Currently active UI language
+ */
+ virtual const hmi_apis::Common_Language::eType active_ui_language() const = 0;
+
+ /*
+ * @brief Sets currently active UI language
+ *
+ * @param language Currently active UI language
+ */
+ virtual void set_active_ui_language(
+ const hmi_apis::Common_Language::eType language) = 0;
+
+ /*
+ * @brief Retrieves UI supported languages
+ *
+ * @return Currently supported UI languages
+ */
+ virtual const smart_objects::SmartObject* ui_supported_languages() const = 0;
+
+ /*
+ * @brief Sets supported UI languages
+ *
+ * @param supported_languages Supported UI languages
+ */
+ virtual void set_ui_supported_languages(
+ const smart_objects::SmartObject& supported_languages) = 0;
+
+ /*
+ * @brief Retrieves currently active VR language
+ *
+ * @return Currently active VR language
+ */
+ virtual const hmi_apis::Common_Language::eType active_vr_language() const = 0;
+
+ /*
+ * @brief Sets currently active VR language
+ *
+ * @param language Currently active VR language
+ */
+ virtual void set_active_vr_language(
+ const hmi_apis::Common_Language::eType language) = 0;
+
+ /*
+ * @brief Retrieves VR supported languages
+ *
+ * @return Currently supported VR languages
+ */
+ virtual const smart_objects::SmartObject* vr_supported_languages() const = 0;
+
+ /*
+ * @brief Sets supported VR languages
+ *
+ * @param supported_languages Supported VR languages
+ */
+ virtual void set_vr_supported_languages(
+ const smart_objects::SmartObject& supported_languages) = 0;
+
+ /*
+ * @brief Retrieves currently active TTS language
+ *
+ * @return Currently active TTS language
+ */
+ virtual const hmi_apis::Common_Language::eType active_tts_language()
+ const = 0;
+
+ /*
+ * @brief Sets currently active TTS language
+ *
+ * @param language Currently active TTS language
+ */
+ virtual void set_active_tts_language(
+ const hmi_apis::Common_Language::eType language) = 0;
+
+ /*
+ * @brief Retrieves TTS supported languages
+ *
+ * @return Currently supported TTS languages
+ */
+ virtual const smart_objects::SmartObject* tts_supported_languages() const = 0;
+
+ /*
+ * @brief Sets supported TTS languages
+ *
+ * @param supported_languages Supported TTS languages
+ */
+ virtual void set_tts_supported_languages(
+ const smart_objects::SmartObject& supported_languages) = 0;
+
+ /*
+ * @brief Retrieves information about the display capabilities
+ *
+ * @return Currently supported display capabilities
+ */
+ virtual const smart_objects::SmartObject* display_capabilities() const = 0;
+
+ /*
+ * @brief Sets supported display capabilities
+ *
+ * @param display_capabilities supported display capabilities
+ */
+ virtual void set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) = 0;
+
+ /*
+ * @brief Retrieves information about the HMI zone capabilities
+ *
+ * @return Currently supported HMI zone capabilities
+ */
+ virtual const smart_objects::SmartObject* hmi_zone_capabilities() const = 0;
+
+ /*
+ * @brief Sets supported HMI zone capabilities
+ *
+ * @param hmi_zone_capabilities supported HMI zone capabilities
+ */
+ virtual void set_hmi_zone_capabilities(
+ const smart_objects::SmartObject& hmi_zone_capabilities) = 0;
+
+ /*
+ * @brief Retrieves information about the SoftButton's capabilities
+ *
+ * @return Currently supported SoftButton's capabilities
+ */
+ virtual const smart_objects::SmartObject* soft_button_capabilities()
+ const = 0;
+
+ /*
+ * @brief Sets supported SoftButton's capabilities
+ *
+ * @param soft_button_capabilities supported SoftButton's capabilities
+ */
+ virtual void set_soft_button_capabilities(
+ const smart_objects::SmartObject& soft_button_capabilities) = 0;
+
+ /*
+ * @brief Retrieves information about the Button's capabilities
+ *
+ * @return Currently supported Button's capabilities
+ */
+ virtual const smart_objects::SmartObject* button_capabilities() const = 0;
+
+ /*
+ * @brief Sets supported Button's capabilities
+ *
+ * @param soft_button_capabilities supported Button's capabilities
+ */
+ virtual void set_button_capabilities(
+ const smart_objects::SmartObject& button_capabilities) = 0;
+
+ /*
+ * @brief Sets supported speech capabilities
+ *
+ * @param speech_capabilities supported speech capabilities
+ */
+ virtual void set_speech_capabilities(
+ const smart_objects::SmartObject& speech_capabilities) = 0;
+
+ /*
+ * @brief Retrieves information about the speech capabilities
+ *
+ * @return Currently supported speech capabilities
+ */
+ virtual const smart_objects::SmartObject* speech_capabilities() const = 0;
+
+ /*
+ * @brief Sets supported VR capabilities
+ *
+ * @param vr_capabilities supported VR capabilities
+ */
+ virtual void set_vr_capabilities(
+ const smart_objects::SmartObject& vr_capabilities) = 0;
+
+ /*
+ * @brief Retrieves information about the VR capabilities
+ *
+ * @return Currently supported VR capabilities
+ */
+ virtual const smart_objects::SmartObject* vr_capabilities() const = 0;
+
+ /*
+ * @brief Sets supported audio_pass_thru capabilities
+ *
+ * @param vr_capabilities supported audio_pass_thru capabilities
+ */
+ virtual void set_audio_pass_thru_capabilities(
+ const smart_objects::SmartObject& audio_pass_thru_capabilities) = 0;
+
+ /*
+ * @brief Retrieves information about the audio_pass_thru capabilities
+ *
+ * @return Currently supported audio_pass_thru capabilities
+ */
+ virtual const smart_objects::SmartObject* audio_pass_thru_capabilities()
+ const = 0;
+
+ /*
+ * @brief Sets supported pcm_stream capabilities
+ *
+ * @param supported pcm_stream capabilities
+ */
+ virtual void set_pcm_stream_capabilities(
+ const smart_objects::SmartObject& pcm_stream_capabilities) = 0;
+
+ /*
+ * @brief Retrieves information about the pcm_stream capabilities
+ *
+ * @return Currently supported pcm_streaming capabilities
+ */
+ virtual const smart_objects::SmartObject* pcm_stream_capabilities() const = 0;
+
+ /*
+ * @brief Retrieves information about the preset bank capabilities
+ *
+ * @return Currently supported preset bank capabilities
+ */
+ virtual const smart_objects::SmartObject* preset_bank_capabilities()
+ const = 0;
+
+ /*
+ * @brief Sets supported preset bank capabilities
+ *
+ * @param soft_button_capabilities supported preset bank capabilities
+ */
+ virtual void set_preset_bank_capabilities(
+ const smart_objects::SmartObject& preset_bank_capabilities) = 0;
+
+ /*
+ * @brief Sets vehicle information(make, model, modelYear)
+ *
+ * @param vehicle_type Cuurent vehicle information
+ */
+ virtual void set_vehicle_type(
+ const smart_objects::SmartObject& vehicle_type) = 0;
+
+ /*
+ * @brief Retrieves vehicle information(make, model, modelYear)
+ *
+ * @param vehicle_type Cuurent vehicle information
+ */
+ virtual const smart_objects::SmartObject* vehicle_type() const = 0;
+
+ /*
+ * @brief Retrieves information about the prerecorded speech
+ *
+ * @return Currently supported prerecorded speech
+ */
+ virtual const smart_objects::SmartObject* prerecorded_speech() const = 0;
+
+ /*
+ * @brief Sets supported prerecorded speech
+ *
+ * @param prerecorded_speech supported prerecorded speech
+ */
+ virtual void set_prerecorded_speech(
+ const smart_objects::SmartObject& prerecorded_speech) = 0;
+
+ /*
+ * @brief Interface used to store information if navigation
+ * supported by the system
+ *
+ * @param supported Indicates if navigation supported by the system
+ */
+ virtual void set_navigation_supported(const bool supported) = 0;
+
+ /*
+ * @brief Retrieves information if navi supported by the system
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual bool navigation_supported() const = 0;
+
+ /*
+ * @brief Interface used to store information if phone call
+ * supported by the system
+ *
+ * @param supported Indicates if navigation supported by the sustem
+ */
+ virtual void set_phone_call_supported(const bool supported) = 0;
+
+ /*
+ * @brief Retrieves information if phone call supported by the system
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual bool phone_call_supported() const = 0;
+
+ virtual void Init(resumption::LastState* last_state) = 0;
+
+ /**
+ * @brief Trigger waiting for response
+ * @param request Request object
+ */
+ virtual void set_handle_response_for(
+ const smart_objects::SmartObject& request) = 0;
+
+ protected:
+ /*
+ * @brief function checks if json member exists
+ *
+ * @param json_member from file hmi_capabilities.json
+ * @param name_of_member name which we should check
+ * hmi_capabilities.json
+ *
+ * @returns TRUE if member exists and returns FALSE if
+ * member does not exist.
+ */
+ virtual bool check_existing_json_member(const Json::Value& json_member,
+ const char* name_of_member) const = 0;
+
+ virtual void convert_json_languages_to_obj(
+ const Json::Value& json_languages,
+ smart_objects::SmartObject& languages) const = 0;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
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..c5af16863a 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,20 @@
#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/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 +74,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 +99,14 @@ 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;
+ virtual uint32_t TimeoutExchangeSec() = 0;
+ virtual uint32_t TimeoutExchangeMSec() = 0;
virtual void OnExceededTimeout() = 0;
virtual void OnSystemReady() = 0;
virtual void PTUpdatedAt(Counters counter, int value) = 0;
@@ -131,11 +146,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 +181,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 +306,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 +324,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 +358,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 +392,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;
@@ -379,8 +417,28 @@ class PolicyHandlerInterface {
virtual const std::string RemoteAppsUrl() const = 0;
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/application_manager/vehicle_info_data.h b/src/components/include/application_manager/vehicle_info_data.h
new file mode 100644
index 0000000000..693353abfe
--- /dev/null
+++ b/src/components/include/application_manager/vehicle_info_data.h
@@ -0,0 +1,71 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
+#define SRC_COMPONENTS_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_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_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..e8e1af715a
--- /dev/null
+++ b/src/components/include/connection_handler/connection_handler.h
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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"
+
+/**
+ * \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_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..e25b0aaea5
--- /dev/null
+++ b/src/components/include/connection_handler/connection_handler_observer.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_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
+#define SRC_COMPONENTS_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_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..10e4231528
--- /dev/null
+++ b/src/components/include/hmi_message_handler/hmi_message_adapter.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_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 {
+ 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_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h
new file mode 100644
index 0000000000..aef1e33379
--- /dev/null
+++ b/src/components/include/hmi_message_handler/hmi_message_observer.h
@@ -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.
+ */
+
+#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 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..95ed2c63c4
--- /dev/null
+++ b/src/components/include/hmi_message_handler/hmi_message_sender.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 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..f3388beb95
--- /dev/null
+++ b/src/components/include/policy/policy_external/policy/policy_listener.h
@@ -0,0 +1,140 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_LISTENER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_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;
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_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..9201956e2a
--- /dev/null
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -0,0 +1,569 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_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 "usage_statistics/statistics_manager.h"
+
+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() {}
+
+ 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;
+
+ 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 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 Exchange by hmi or mobile request
+ */
+ virtual std::string ForcePTExchange() = 0;
+
+ /**
+ * @brief ExchangeByUserRequest
+ */
+ virtual std::string ForcePTExchangeAtUserRequest() = 0;
+
+ /**
+ * Resets retry sequence
+ */
+ virtual void ResetRetrySequence() = 0;
+
+ /**
+ * 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;
+
+ /**
+ * 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;
+
+ /**
+ * 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.
+ */
+ virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ const 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,
+ 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
+ * @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;
+
+ /**
+ * 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
+ * @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
+ * @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) const = 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(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;
+
+ /**
+ * @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 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;
+
+ 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;
+
+ /**
+ * @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 "external consent
+ * status" section
+ * @param status ExternalConsent status
+ * @return true if there's such a need, otherwise - false
+ */
+ 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 external consent status
+ */
+ virtual ExternalConsentStatus GetExternalConsentStatus() = 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_INCLUDE_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..45883163c4
--- /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_USAGE_STATISTICS_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+
+#include "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/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..8cf3beaa55
--- /dev/null
+++ b/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.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_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 {
+ 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() {}
+ 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/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h
new file mode 100644
index 0000000000..c8074b3528
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -0,0 +1,521 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_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"
+
+namespace policy {
+class PolicySettings;
+typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+
+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 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 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& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) = 0;
+
+ 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;
+
+ /**
+ * 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 Exchange by hmi or mobile request
+ */
+ virtual std::string ForcePTExchange() = 0;
+
+ /**
+ * @brief ExchangeByUserRequest
+ */
+ virtual std::string ForcePTExchangeAtUserRequest() = 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 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;
+
+ /**
+ * 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
+ * @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
+ * @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) const = 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(const bool trigger_ptu) = 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;
+
+ /**
+ * @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;
+
+ 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;
+
+ /**
+ * @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:
+ /**
+ * 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_POLICY_REGULAR_INCLUDE_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/statistics_manager.h b/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h
new file mode 100644
index 0000000000..8cf3beaa55
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.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_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 {
+ 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() {}
+ 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/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 4a387b8b13..0000000000
--- a/src/components/include/policy/usage_statistics/statistics_manager.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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 {
- 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() {}
- 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_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/security_manager/crypto_manager.h b/src/components/include/security_manager/crypto_manager.h
index 9b11a8e4ae..18c06ffe06 100644
--- a/src/components/include/security_manager/crypto_manager.h
+++ b/src/components/include/security_manager/crypto_manager.h
@@ -58,7 +58,7 @@ class CryptoManager : public policy::PolicyHandlerObserver {
/**
* @brief Init allows to initialize cryptomanager with certain values.
*
- * @return true in case initialization was succesfull, false otherwise.
+ * @return true in case initialization was succesful, false otherwise.
*/
virtual bool Init() = 0;
virtual SSLContext* CreateSSLContext() = 0;
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
new file mode 100644
index 0000000000..c59eb276ce
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_app_launch_settings.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_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_LAUNCH_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_LAUNCH_SETTINGS_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/app_launch_settings.h"
+
+namespace test {
+namespace components {
+namespace app_launch_test {
+
+class MockAppLaunchSettings : public app_launch::AppLaunchSettings {
+ public:
+ MOCK_CONST_METHOD0(app_launch_wait_time, const uint16_t());
+ MOCK_CONST_METHOD0(app_launch_max_retry_attempt, const uint16_t());
+ MOCK_CONST_METHOD0(app_launch_retry_wait_time, const uint16_t());
+ MOCK_CONST_METHOD0(remove_bundle_id_attempts, const uint16_t());
+ MOCK_CONST_METHOD0(max_number_of_ios_device, const uint16_t());
+ MOCK_CONST_METHOD0(wait_time_between_apps, const uint16_t());
+ MOCK_CONST_METHOD0(enable_app_launch_ios, const bool());
+ MOCK_CONST_METHOD0(resumption_delay_after_ign, const uint32_t());
+ MOCK_CONST_METHOD0(app_storage_folder, std::string&());
+};
+
+} // namespace app_launch_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_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..fc9b213d04
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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/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"
+#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());
+ 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_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>(
+ 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_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(
+ 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>());
+
+ MOCK_METHOD1(ReplaceMobileByHMIAppId,
+ void(smart_objects::SmartObject& message));
+ MOCK_METHOD1(ReplaceHMIByMobileAppId,
+ 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());
+};
+
+} // 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 b1c32c982b..fd9e2aa8a3 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
@@ -90,11 +90,11 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(app_resumption_save_persistent_data_timeout,
const uint32_t&());
MOCK_CONST_METHOD0(resumption_delay_before_ign, uint32_t());
- MOCK_CONST_METHOD0(resumption_delay_after_ign, uint32_t());
+ MOCK_CONST_METHOD0(resumption_delay_after_ign, const uint32_t());
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.
@@ -113,6 +113,15 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(app_time_scale, const uint32_t&());
MOCK_CONST_METHOD0(app_time_scale_max_requests, const uint32_t&());
MOCK_CONST_METHOD0(pending_requests_amount, const uint32_t&());
+
+ // app_launch::AppLaunchSettings
+ MOCK_CONST_METHOD0(app_launch_wait_time, const uint16_t());
+ MOCK_CONST_METHOD0(app_launch_max_retry_attempt, const uint16_t());
+ MOCK_CONST_METHOD0(app_launch_retry_wait_time, const uint16_t());
+ MOCK_CONST_METHOD0(remove_bundle_id_attempts, const uint16_t());
+ MOCK_CONST_METHOD0(max_number_of_ios_device, const uint16_t());
+ MOCK_CONST_METHOD0(wait_time_between_apps, const uint16_t());
+ MOCK_CONST_METHOD0(enable_app_launch_ios, const bool());
};
} // namespace application_manager_test
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..8f6972fd52 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_METHOD0(TimeoutExchangeSec, uint32_t());
+ MOCK_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,29 @@ 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));
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 eac82cc177..e17224b097 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler.h
@@ -59,6 +59,8 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
MOCK_METHOD0(StartTransportManager, void());
MOCK_METHOD1(ConnectToDevice,
void(connection_handler::DeviceHandle device_handle));
+ MOCK_CONST_METHOD2(RunAppOnDevice,
+ void(const std::string&, const std::string&));
MOCK_METHOD0(ConnectToAllDevices, void());
MOCK_METHOD1(CloseRevokedConnection, void(uint32_t connection_key));
MOCK_METHOD1(CloseConnection, void(ConnectionHandle connection_handle));
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..6ca4557b35
--- /dev/null
+++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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));
+ 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_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..fcbae93a70 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"
@@ -49,4 +49,4 @@ class MockHMIMessageHandlerSettings
} // 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_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
new file mode 100644
index 0000000000..893d5a334f
--- /dev/null
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
@@ -0,0 +1,101 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_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>&));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_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..0332b94a89
--- /dev/null
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_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));
+ 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&));
+};
+} // 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_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_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
new file mode 100644
index 0000000000..1ccca81d79
--- /dev/null
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
+
+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));
+ 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));
+};
+
+} // 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/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_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..c376cb85f5 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>
@@ -108,4 +108,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/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.h b/src/components/include/test/transport_manager/mock_transport_manager.h
index 618e85a4fa..cc8bd5ab85 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager.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
@@ -65,6 +65,7 @@ class MockTransportManager : public ::transport_manager::TransportManager,
MOCK_METHOD1(DisconnectForce, int(const ConnectionUID));
MOCK_METHOD1(SendMessageToDevice,
int(const ::protocol_handler::RawMessagePtr));
+ MOCK_METHOD2(RunAppOnDevice, void(const DeviceHandle, const std::string&));
MOCK_METHOD1(ReceiveEventFromDevice, int(const TransportAdapterEvent&));
MOCK_METHOD1(AddTransportAdapter, int(TransportAdapter* adapter));
MOCK_METHOD1(AddEventListener, int(TransportManagerListener* listener));
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..dfa2cbc31d
--- /dev/null
+++ b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
@@ -0,0 +1,90 @@
+/*
+ * 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));
+};
+
+} // 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..00da2025dd 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"
@@ -65,4 +65,4 @@ class MockTransportManagerSettings
} // 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..16e6ddcb7a
--- /dev/null
+++ b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.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_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));
+
+#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..2d53d5d7c8
--- /dev/null
+++ b/src/components/include/test/utils/test_async_waiter.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.
+ */
+
+#pragma once
+
+#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
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
index a1dd7b9bcf..3adb6cd2e6 100644
--- a/src/components/include/transport_manager/transport_adapter/device.h
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -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
@@ -38,6 +38,7 @@
#include "transport_manager/common.h"
#include "utils/shared_ptr.h"
+#include "utils/macro.h"
namespace transport_manager {
namespace transport_adapter {
@@ -76,6 +77,15 @@ class Device {
virtual ApplicationList GetApplicationList() const = 0;
+ /**
+ * @brief LaunchApp allows to run appropriate application on the device.
+ *
+ * @param bundle_id application identifier to run.
+ */
+ virtual void LaunchApp(const std::string& bundle_id) const {
+ UNUSED(bundle_id);
+ }
+
virtual void Stop() {}
inline const DeviceUID& unique_device_id() const {
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 3ff1aa6eee..ee726ff1d3 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -2,7 +2,7 @@
* \file transport_adapter.h
* \brief TransportAdapter class header file.
*
- * 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
@@ -175,6 +175,18 @@ class TransportAdapter {
virtual Error ConnectDevice(const DeviceUID& 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_uid,
+ const std::string& bundle_id) = 0;
+
+ /**
* @brief Notify that listener of client connection is available.
*
* @return true - available, false - not available.
diff --git a/src/components/include/transport_manager/transport_manager.h b/src/components/include/transport_manager/transport_manager.h
index 718f9e12aa..0847886c46 100644
--- a/src/components/include/transport_manager/transport_manager.h
+++ b/src/components/include/transport_manager/transport_manager.h
@@ -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
@@ -121,6 +121,18 @@ class TransportManager {
const protocol_handler::RawMessagePtr message) = 0;
/**
+ * @brief RunAppOnDevice allows run specific application on the certain
+ *device.
+ *
+ * @param device_handle device identifier to run application on.
+ *
+ * @param bundle_id application id alsow known as bundle id on some devices to
+ *run.
+ */
+ virtual void RunAppOnDevice(const DeviceHandle device_handle,
+ const std::string& bundle_id) = 0;
+
+ /**
* @brief Post event in the event queue.
*
* @param event Current event information.
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/logger.h b/src/components/include/utils/logger.h
index 11a2f1f0d9..75daa552a2 100644
--- a/src/components/include/utils/logger.h
+++ b/src/components/include/utils/logger.h
@@ -137,9 +137,11 @@ log4cxx_time_t time_now();
#define CREATE_LOGGERPTR_LOCAL(logger_var, logger_name)
-#define INIT_LOGGER(file_name)
+#define INIT_LOGGER(file_name, logs_enabled)
-#define DEINIT_LOGGER(file_name)
+#define DEINIT_LOGGER()
+
+#define FLUSH_LOGGER()
#define LOG4CXX_IS_TRACE_ENABLED(logger) false
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 f778649b86..0d6d5fad3d 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -34,7 +34,7 @@
<interfaces name="SmartDeviceLink HMI API">
-<interface name="Common" version="1.4" date="2016-05-11">
+<interface name="Common" version="1.6.0" date="2017-04-27">
<enum name="Result">
<element name="SUCCESS" value="0"/>
@@ -243,10 +243,10 @@
</enum>
<struct name="Coordinate">
- <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Double" mandatory="true">
+ <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="Double" mandatory="true">
+ <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
<description>Longitude of the location.</description>
</param>
</struct>
@@ -382,6 +382,7 @@
<description> 5 inch GEN1.1 display </description>
</element>
<element name="GEN3_8_INCH"/>
+ <element name="SDL_GENERIC" />
</enum>
<enum name="ImageType">
@@ -1206,22 +1207,26 @@
</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"/>
@@ -1234,17 +1239,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>
@@ -1253,6 +1259,23 @@
<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 -->
<struct name="TextField">
@@ -1679,9 +1702,9 @@
<!--IVI part-->
<struct name="GPSData">
<description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Double" minvalue="-180" maxvalue="180" mandatory="false">
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
</param>
- <param name="latitudeDegrees" type="Double" minvalue="-90" maxvalue="90" mandatory="false">
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
</param>
<param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
<description>The current UTC year.</description>
@@ -1980,31 +2003,34 @@
<!--end of IVI part-->
<struct name="DateTime">
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="true">
- <description>Seconds part of time</description>
- </param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
- <description>Minutes part of time</description>
- </param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="true">
- <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="true">
- <description>Day of the month</description>
- </param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="true">
- <description>Month of the year</description>
- </param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="true">
- <description>The year in YYYY format</description>
- </param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="true">
- <description>Time zone offset in Hours wrt UTC.</description>
- </param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="true">
- <description>Time zone offset in Min wrt UTC.</description>
- </param>
- </struct>
+ <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">
@@ -2062,7 +2088,7 @@
</interface>
-<interface name="Buttons" version="1.1" date="2016-08-18">
+<interface name="Buttons" version="1.2.0" date="2017-04-27">
<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>
@@ -2129,7 +2155,7 @@
</function>
</interface>
-<interface name="BasicCommunication" version="1.0" date="2013-04-12">
+<interface name="BasicCommunication" version="1.2.0" date="2017-04-27">
<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>
@@ -2139,21 +2165,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">
@@ -2355,8 +2366,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">
@@ -2454,17 +2465,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">
@@ -2476,7 +2486,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>
@@ -2625,7 +2635,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>
@@ -2751,7 +2761,7 @@
</function>
</interface>
-<interface name="UI" version="1.0" date="2013-04-16">
+<interface name="UI" version="1.1.0" date="2017-04-27">
<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">
@@ -3244,7 +3254,7 @@
</function>
</interface>
-<interface name="Navigation" version="1.2" date="2016-06-09">
+<interface name="Navigation" version="1.4.0" date="2017-04-27">
<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>
@@ -3411,12 +3421,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">
@@ -3449,7 +3459,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>
@@ -4081,7 +4091,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>
@@ -4157,19 +4167,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"/>
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 1bff09ef38..953f270741 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-<interface name="Ford Sync RAPI" version="4.1" date="2016-04-08">
+<interface name="Ford Sync RAPI" version="4.4.0" date="2017-04-27">
<enum name="Result" internal_scope="base">
<element name="SUCCESS">
@@ -580,6 +580,7 @@
<element name="MFD4" />
<element name="MFD5" />
<element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" />
+ <element name="SDL_GENERIC" />
</enum>
<enum name="TextFieldName">
@@ -875,6 +876,9 @@
<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>
+ <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">
@@ -1283,6 +1287,26 @@
</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 -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
@@ -2202,9 +2226,9 @@
<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"/>
+ <element name="GetWayPointsID" value="45" hexvalue="2D" />
+ <element name="SubscribeWayPointsID" value="46" hexvalue="2E"/>
+ <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F"/>
<!--
Base Notifications
@@ -2226,7 +2250,7 @@
<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" />
+ <element name="OnWayPointChangeID" value="32784" hexvalue="8010" />
<!--
Ford Specific Request / Response RPCs
@@ -2256,32 +2280,35 @@
<element name="notification" value="2" />
</enum>
- <struct name="DateTime">
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="true">
- <description>Seconds part of time</description>
- </param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
- <description>Minutes part of time</description>
- </param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="true">
- <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="true">
- <description>Day of the month</description>
- </param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="true">
- <description>Month of the year</description>
- </param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="true">
- <description>The year in YYYY format</description>
- </param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="true">
- <description>Time zone offset in Hours wrt UTC.</description>
- </param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="true">
- <description>Time zone offset in Min wrt UTC.</description>
- </param>
- </struct>
+ <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>
@@ -2290,10 +2317,10 @@
</enum>
<struct name="Coordinate">
- <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Double" mandatory="true">
+ <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="Double" mandatory="true">
+ <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
<description>Longitude of the location.</description>
</param>
</struct>
@@ -2446,6 +2473,11 @@
<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">
@@ -4789,9 +4821,9 @@
</function>
<function name="SendLocation" functionID="SendLocationID" messagetype="request">
- <param name="longitudeDegrees" type="Double" minvalue="-180" maxvalue="180" mandatory="false">
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
</param>
- <param name="latitudeDegrees" type="Double" minvalue="-90" maxvalue="90" mandatory="false">
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
</param>
<param name="locationName" type="String" maxlength="500" mandatory="false">
<description>
@@ -4889,6 +4921,86 @@
</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" 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">
+ <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>
+ <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">
+ <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>
+
<!-- Notifications -->
<function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
@@ -5096,7 +5208,7 @@
<param name="requestType" type="RequestType" mandatory="true">
<description>The type of system request.</description>
</param>
- <param name="url" type="String" maxlength="1000" minsize="1" maxsize="100" array="true" mandatory="false">
+ <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.
@@ -5130,6 +5242,13 @@
</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>
+
<!-- ~~~~~~~~~~~~~~~~~~ -->
<!-- Ford Specific APIs -->
<!-- ~~~~~~~~~~~~~~~~~~ -->
@@ -5221,90 +5340,6 @@
</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" >
diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml
index 85a4d4143f..2d53559ad1 100644
--- a/src/components/interfaces/QT_HMI_API.xml
+++ b/src/components/interfaces/QT_HMI_API.xml
@@ -2237,6 +2237,15 @@
<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->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 -->
</interface>
<interface name="VR" version="1.0" date="2013-04-17">
diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt
index 69af6e7841..c5b94ea7e1 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,60 +28,10 @@
# 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}
- ${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_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_directories(
include
${COMPONENTS_DIR}/media_manager/include/audio/
${COMPONENTS_DIR}/media_manager/include/video/
@@ -92,25 +42,67 @@ include_directories (
${COMPONENTS_DIR}/smart_objects/include/
${COMPONENTS_DIR}/hmi_message_handler/include/
${COMPONENTS_DIR}/formatters/include/
+ ${COMPONENTS_DIR}/rpc_base/include/
${COMPONENTS_DIR}/config_profile/include/
${JSONCPP_INCLUDE_DIRECTORY}
${CMAKE_BINARY_DIR}/src/components/
- ${COMPONENTS_DIR}/policy/include/
+ ${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
)
-add_library("MediaManager" ${SOURCES} ${default_sources})
+set(EXCLUDE_PATHS
+ video_stream_to_file_adapter.cc
+)
+
+set(LIBRARIES
+ MOBILE_API
+ ProtocolLibrary
+ Utils
+)
+
+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/a2dp_source_player_adapter.h b/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
index 3f262b27bb..54d898b7b2 100644
--- a/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
+++ b/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
@@ -37,11 +37,16 @@
#include "protocol/common.h"
#include "media_manager/media_adapter_impl.h"
#include "utils/threads/thread_delegate.h"
+#include "connection_handler/connection_handler_impl.h"
namespace protocol_handler {
class SessionObserver;
}
+namespace connection_handler {
+class ConnectionHandlerImpl;
+}
+
namespace threads {
class Thread;
}
@@ -70,6 +75,7 @@ class A2DPSourcePlayerAdapter : public MediaAdapterImpl {
typedef std::map<int32_t, Pair> SourcesMap;
SourcesMap sources_;
protocol_handler::SessionObserver& session_observer_;
+ connection_handler::ConnectionHandlerImpl* connection_handler_;
DISALLOW_COPY_AND_ASSIGN(A2DPSourcePlayerAdapter);
};
diff --git a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
index 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/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/src/audio/a2dp_source_player_adapter.cc b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
index e5cd41c8c3..5e9d6ab0ba 100644
--- a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
+++ b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
@@ -91,9 +91,6 @@ void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) {
if (application_key != current_application_) {
current_application_ = application_key;
- const protocol_handler::SessionObserver&
- session_observer =->connection_handler().get_session_observer();
-
uint32_t device_id = 0;
session_observer_.GetDataOnSessionKey(application_key, 0, NULL, &device_id);
std::string mac_adddress;
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 49ead6a662..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")
@@ -80,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/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index e531894b27..b89fc4c71f 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -114,8 +114,6 @@ void MediaManagerImpl::Init() {
#if defined(EXTENDED_MEDIA_MODE)
LOG4CXX_INFO(logger_, "Called Init with default configuration.");
- a2dp_player_ =
- new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer());
from_mic_recorder_ = new FromMicRecorderAdapter();
#endif
@@ -157,6 +155,14 @@ void MediaManagerImpl::Init() {
void MediaManagerImpl::PlayA2DPSource(int32_t application_key) {
LOG4CXX_AUTO_TRACE(logger_);
+
+#if defined(EXTENDED_MEDIA_MODE)
+ if (!a2dp_player_ && protocol_handler_) {
+ a2dp_player_ =
+ new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer());
+ }
+#endif
+
if (a2dp_player_) {
a2dp_player_->StartActivity(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..f9618c7fb8 100644
--- a/src/components/media_manager/test/media_manager_impl_test.cc
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -32,9 +32,9 @@
#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 "media_manager/mock_media_adapter.h"
+#include "media_manager/mock_media_adapter_listener.h"
+#include "media_manager/mock_media_adapter_impl.h"
#include "protocol_handler/mock_protocol_handler.h"
#include "media_manager/mock_media_manager_settings.h"
#include "application_manager/mock_application_manager.h"
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..3e5fc41721
--- /dev/null
+++ b/src/components/policy/policy_external/.gitignore
@@ -0,0 +1,85 @@
+*.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
+src/components/qt_hmi/qml_plugins/dbus/libhmi_dbus.so
+src/components/qt_hmi/qml_plugins/hmi_framework/libHmiFramework.so
+
+# install folders
+src/components/qt_hmi/qml_model/com/ford/sdl
+
+# ctags-generated
+tags
+
+# Qt
+moc_*.cpp
+*.pro.user
+*.qmlproject.user
+*_automoc.cpp
+
+# generated files
+src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus.cc
+src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus.h
+src/components/qt_hmi/qml_model/hmi_api/*Proxy.qml
+
+# 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..2cbdbd7f64
--- /dev/null
+++ b/src/components/policy/policy_external/CMakeLists.txt
@@ -0,0 +1,121 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (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
+)
+
+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/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h
new file mode 100644
index 0000000000..95aed36f89
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -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.
+ */
+
+#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;
+
+ 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);
+
+ 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_;
+
+ 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_;
+};
+} // 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..66631f32cf
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
@@ -0,0 +1,794 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 "utils/shared_ptr.h"
+#include "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;
+
+#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..10d6908b14
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_helper.h
@@ -0,0 +1,328 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 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);
+}
+
+#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..a37d0d66b9
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
@@ -0,0 +1,508 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace policy {
+struct CheckAppPolicy;
+
+class PolicyManagerImpl : public PolicyManager {
+ public:
+ PolicyManagerImpl();
+ explicit PolicyManagerImpl(bool in_memory);
+ 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 std::string GetUpdateUrl(int service_type);
+ virtual void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points);
+ virtual void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points);
+ virtual void RequestPTUpdate();
+ virtual void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result);
+ virtual bool ResetUserConsent();
+ virtual void KmsChanged(int kilometers);
+ virtual void IncrementIgnitionCycles();
+ virtual std::string ForcePTExchange();
+ virtual std::string ForcePTExchangeAtUserRequest();
+ virtual std::string GetPolicyTableStatus() const;
+ virtual void ResetRetrySequence();
+ virtual int NextRetryTimeout();
+ virtual uint32_t TimeoutExchangeMSec();
+ virtual const std::vector<int> RetrySequenceDelaysSeconds();
+ virtual void OnExceededTimeout();
+ virtual std::string GetLockScreenIconUrl() const OVERRIDE;
+ 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,
+ const bool is_allowed);
+ virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ const 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);
+
+ void SetUserConsentForApp(const PermissionConsent& permissions,
+ const NotificationMode mode) OVERRIDE;
+
+ 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,
+ const std::string& active_hmi_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);
+
+ StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types);
+
+ 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) const OVERRIDE;
+ void set_cache_manager(CacheManagerInterface* cache_manager);
+
+ virtual void OnAppsSearchStarted();
+
+ virtual void OnAppsSearchCompleted(const bool trigger_ptu);
+
+#ifdef BUILD_TESTS
+ inline CacheManagerInterfaceSPtr GetCache() {
+ return cache_;
+ }
+ 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
+
+ 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);
+
+ virtual const MetaInfo GetMetaInfo() const OVERRIDE;
+
+ virtual std::string RetrieveCertificate() const OVERRIDE;
+
+ virtual bool HasCertificate() const OVERRIDE;
+
+ virtual void SetDecryptedCertificate(const std::string& certificate) OVERRIDE;
+
+ const PolicySettings& get_settings() const OVERRIDE;
+
+ AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+
+ 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;
+
+ /**
+ * @brief Gets customer connectivity settings status
+ * @return ExternalConsent status
+ */
+ bool SetExternalConsentStatus(const ExternalConsentStatus& status) OVERRIDE;
+ ExternalConsentStatus GetExternalConsentStatus() OVERRIDE;
+
+ protected:
+ virtual utils::SharedPtr<policy_table::Table> Parse(
+ const BinaryMessage& pt_content);
+
+ private:
+ 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 sending OnPermissionChange and
+ * OnAppPermissionChanged notifications
+ * @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 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;
+
+ /**
+ * @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;
+
+ PolicyListener* listener_;
+
+ UpdateStatusManager update_status_manager_;
+ CacheManagerInterfaceSPtr cache_;
+ sync_primitives::Lock apps_registration_lock_;
+ 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_;
+
+ /**
+ * Timeout to wait response with UpdatePT
+ */
+ int 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_;
+
+ /**
+ * @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;
+
+ /**
+ * @brief Pair of app index and url index from Endpoints vector
+ * that contains all application URLs
+ */
+ RetrySequenceURL retry_sequence_url_;
+ friend struct ProccessAppGroups;
+
+ bool wrong_ptu_update_received_;
+ bool send_on_update_sent_out_;
+ 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..45fad03dae
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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
+};
+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..774ef3ee59
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_table/types.h
@@ -0,0 +1,583 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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, 65535> Rpc;
+
+typedef Array<String<10, 65535>, 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;
+
+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;
+
+ 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;
+};
+
+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 kMandatoryLanguage_;
+};
+
+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..eff8cfdf7b
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_types.h
@@ -0,0 +1,507 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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";
+const std::string kPrimary = "rc_primaryDevice";
+
+/*
+ *@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() {}
+
+ 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 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..685c84742f
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/sql_pt_queries.h
@@ -0,0 +1,148 @@
+/*
+ Copyright (c) 2013, " Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, " with or without
+ modification, " are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, " this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, "
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
+ CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR 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 kDeleteAppGroupPrimaryByApplicationId;
+extern const std::string kDeleteAppGroupNonPrimaryByApplicationId;
+extern const std::string kCollectFriendlyMsg;
+extern const std::string kSelectAppGroupsPrimary;
+extern const std::string kSelectAppGroupsNonPrimary;
+extern const std::string kSelectModuleTypes;
+extern const std::string kInsertAppGroupPrimary;
+extern const std::string kInsertAppGroupNonPrimary;
+extern const std::string kInsertModuleType;
+extern const std::string kInsertInteriorZone;
+extern const std::string kCountInteriorZones;
+extern const std::string kSelectInteriorZones;
+extern const std::string kDeleteInteriorZones;
+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 kDeleteAppGroupPrimary;
+extern const std::string kDeleteAppGroupNonPrimary;
+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..b3ce0a69be
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
@@ -0,0 +1,211 @@
+/*
+ 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:
+ 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..53925c599a
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/status.h
@@ -0,0 +1,195 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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
+};
+
+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/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
new file mode 100644
index 0000000000..7c247f1759
--- /dev/null
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -0,0 +1,2666 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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) {
+ InitBackupThread();
+}
+
+CacheManager::CacheManager(bool in_memory)
+ : CacheManagerInterface()
+ , pt_(new policy_table::Table)
+ , backup_(new SQLPTExtRepresentation(in_memory))
+ , update_required(false) {
+ 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);
+ 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) {
+ 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 = 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);
+ 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) {
+ 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()) {
+ return &(*i->second.AppHMIType);
+ }
+ 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);
+ 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);
+ 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);
+ 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();
+ 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();
+ 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();
+ 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 reresented");
+ return;
+ }
+
+ 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();
+ 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;
+ RequestTypes merged_pt_request_types;
+
+ 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.");
+ return;
+ }
+ 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.");
+ return;
+ }
+ LOG4CXX_INFO(logger_,
+ "Application " << app_id
+ << " has empty RequestTypes."
+ " Any parameter will be allowed.");
+ }
+ merged_pt_request_types = new_request_types;
+ } else {
+ merged_pt_request_types = new_request_types;
+ }
+ 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 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;
+ }
+ ProcessUpdate(iter_default);
+ } 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();
+ 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 {
+ 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);
+ 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();
+ 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();
+ if (out_app_permissions_changed) {
+ *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);
+ 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();
+
+ 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);
+ 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:" << 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);
+ 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(uint16_t current) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(0);
+
+ 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();
+ 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 *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+}
+
+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,
+ 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();
+ 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);
+
+ 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;
+
+ 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);
+ 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()) {
+ 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;
+
+ 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_);
+ sync_primitives::AutoLock lock(cache_lock_);
+ snapshot_ = new policy_table::Table();
+ 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);
+ 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;
+ 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;
+ }
+
+ 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);
+ *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;
+ 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);
+ *pt_->policy_table.module_meta->language = language;
+ 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 = 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);
+ 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);
+
+ 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 {
+ 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) {
+ 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);
+ cache_lock_.Acquire();
+ *pt_->policy_table.module_meta->vin = value;
+ cache_lock_.Release();
+ Backup();
+ return true;
+}
+
+bool CacheManager::IsApplicationRepresented(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ 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);
+ }
+}
+
+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.");
+
+ 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
+
+ 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();
+ 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_);
+ 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(""));
+ 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_;
+}
+
+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/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc
new file mode 100644
index 0000000000..12a02824f2
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -0,0 +1,870 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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();
+}
+
+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& rpc_hmi_permissions = rpc.hmi_permissions;
+ 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& rpc_parameter_permissions = rpc.parameter_permissions;
+ 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;
+}
+}
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..0a774f6b79
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -0,0 +1,1883 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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"
+
+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)
+ , 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))
+ , 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());
+
+ // 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) {
+ CheckAppPolicyResults::const_iterator it_results = results.begin();
+
+ for (; results.end() != it_results; ++it_results) {
+ const policy_table::ApplicationPolicies::const_iterator app_policy =
+ app_policies.find(it_results->first);
+
+ if (app_policies.end() == app_policy) {
+ continue;
+ }
+
+ if (IsPredefinedApp(*app_policy)) {
+ continue;
+ }
+
+ switch (it_results->second) {
+ case RESULT_NO_CHANGES:
+ continue;
+ case RESULT_APP_REVOKED:
+ NotifySystem(*app_policy);
+ continue;
+ case RESULT_NICKNAME_MISMATCH:
+ NotifySystem(*app_policy);
+ continue;
+ case RESULT_CONSENT_NEEDED:
+ case RESULT_PERMISSIONS_REVOKED_AND_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;
+ }
+ }
+ } break;
+ case RESULT_CONSENT_NOT_REQIURED:
+ case RESULT_PERMISSIONS_REVOKED:
+ case RESULT_REQUEST_TYPE_CHANGED:
+ break;
+ default:
+ continue;
+ }
+ NotifySystem(*app_policy);
+ 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);
+
+ policy_table::Strings app_groups = GetGroupsNames(app_group_permissions);
+
+ // 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() {
+ bool result = true;
+ result = cache_->ResetUserConsent();
+
+ return result;
+}
+
+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);
+
+ 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;
+ 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];
+
+ // 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);
+}
+
+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;
+}
+
+} // 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..e70167c94b
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -0,0 +1,723 @@
+// 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_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;
+ 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(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;
+ }
+}
+
+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..d7dd986abc
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -0,0 +1,2134 @@
+#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")) {}
+
+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__);
+ 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;
+ }
+ 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;
+ }
+ 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"));
+ }
+}
+
+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);
+}
+
+// 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::kMandatoryLanguage_("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(kMandatoryLanguage_)) {
+ 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(kMandatoryLanguage_)) {
+ report__->set_validation_info("no mandatory language '" +
+ kMandatoryLanguage_ + "' is present");
+ }
+}
+
+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 (!consent_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..45034c6fe8
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_table/validation.cc
@@ -0,0 +1,256 @@
+#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;
+}
+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;
+ }
+ }
+ }
+ return true;
+}
+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;
+ }
+ 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..1cd789f00d
--- /dev/null
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -0,0 +1,972 @@
+/*
+ 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), "
+ " `user_consent_passengersRC` BOOL,"
+ " `country_consent_passengersRC` BOOL "
+ "); "
+ "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, "
+ " `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, "
+ " `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), "
+ " `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, "
+ " `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, "
+ " 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 TABLE IF NOT EXISTS `app_group_primary`( "
+ " `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_primary.fk_application_has_functional_group_functional_group1_"
+ "idx` "
+ " ON `app_group_primary`(`functional_group_id`); "
+ "CREATE INDEX IF NOT EXISTS "
+ "`app_group_primary.fk_application_has_functional_group_application1_idx` "
+ " ON `app_group_primary`(`application_id`); "
+
+ "CREATE TABLE IF NOT EXISTS `app_group_non_primary`( "
+ " `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_non_primary.fk_application_has_functional_group_functional_"
+ "group1_idx` "
+ " ON `app_group_non_primary`(`functional_group_id`); "
+ "CREATE INDEX IF NOT EXISTS "
+ "`app_group_non_primary.fk_application_has_functional_group_application1_"
+ "idx` "
+ " ON `app_group_non_primary`(`application_id`); "
+
+ /* interior_zone */
+ "CREATE TABLE `interior_zone`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(100) NOT NULL, "
+ " `col` INTEGER NOT NULL, "
+ " `row` INTEGER NOT NULL, "
+ " `level` INTEGER NOT NULL "
+ "); "
+ "CREATE UNIQUE INDEX `interior_zone.room` ON "
+ "`interior_zone`(`col`,`row`,`level`); "
+
+ /* access_module */
+ "CREATE TABLE `access_module`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(45) NOT NULL, "
+ " `zone_id` INTEGER NOT NULL, "
+ " `user_consent_needed` INTEGER NOT NULL, "
+ "CONSTRAINT `fk_module_1` "
+ " FOREIGN KEY(`zone_id`) "
+ " REFERENCES `interior_zone`(`id`) "
+ "); "
+ "CREATE INDEX `access_module.zone_module` ON "
+ "`access_module`(`name`,`zone_id`); "
+ "CREATE INDEX `access_module.fk_module_1_idx` ON "
+ "`access_module`(`zone_id`); "
+
+ /* 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 "
+ " ); "
+ "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 kDeleteAppGroupPrimary = "DELETE FROM `app_group_primary`";
+
+const std::string kDeleteAppGroupNonPrimary =
+ "DELETE FROM `app_group_non_primary`";
+
+const std::string kDeleteModuleTypes = "DELETE FROM `module_type`";
+
+const std::string kDeleteAllDevices = "DELETE FROM `device`;";
+
+const std::string kSelectAppGroupsPrimary =
+ "SELECT `f`.`name` FROM `app_group_primary` AS `a`"
+ " LEFT JOIN `functional_group` AS `f` "
+ " ON (`f`.`id` = `a`.`functional_group_id`)"
+ " WHERE `a`.`application_id` = ?";
+
+const std::string kSelectAppGroupsNonPrimary =
+ "SELECT `f`.`name` FROM `app_group_non_primary` AS `a`"
+ " LEFT JOIN `functional_group` AS `f` "
+ " ON (`f`.`id` = `a`.`functional_group_id`)"
+ " WHERE `a`.`application_id` = ?";
+
+const std::string kSelectRemoteControlDenied =
+ "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1";
+
+const std::string kInsertAppGroupPrimary =
+ "INSERT INTO `app_group_primary` (`application_id`, `functional_group_id`)"
+ " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1";
+
+const std::string kInsertAppGroupNonPrimary =
+ "INSERT INTO `app_group_non_primary` (`application_id`, "
+ "`functional_group_id`)"
+ " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1";
+
+const std::string kUpdateRemoteControlDenied =
+ "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?";
+
+const std::string kCountInteriorZones =
+ "SELECT COUNT(`id`) FROM `interior_zone`";
+
+const std::string kDeleteInteriorZones = "DELETE FROM `interior_zone`";
+
+const std::string kDeleteAccessModules = "DELETE FROM `access_module`";
+
+const std::string kDeleteRemoteRpc = "DELETE FROM `remote_rpc`";
+
+const std::string kInsertInteriorZone =
+ "INSERT INTO `interior_zone` (`name`, `col`, `row`, `level`) "
+ " VALUES(?, ?, ?, ?)";
+
+const std::string kSelectInteriorZones =
+ "SELECT `id`, `name`, `col`, `row`, `level` FROM `interior_zone`";
+
+const std::string kInsertAccessModule =
+ "INSERT INTO `access_module` (`name`, `zone_id`, `user_consent_needed`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kDeleteAppGroupPrimaryByApplicationId =
+ "DELETE FROM `app_group_primary` WHERE `application_id` = ?";
+
+const std::string kDeleteAppGroupNonPrimaryByApplicationId =
+ "DELETE FROM `app_group_non_primary` WHERE `application_id` = ?";
+
+const std::string kSelectAccessModules =
+ "SELECT `id`, `name` FROM `access_module` "
+ " WHERE `zone_id` = ? AND `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 INDEX IF EXISTS "
+ "`app_group_primary.fk_application_has_functional_group_application1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`app_group_primary.fk_application_has_functional_group_functional_group1_"
+ "idx`; "
+ "DROP TABLE IF EXISTS `app_group_primary`; "
+ "DROP INDEX IF EXISTS "
+ "`app_group_non_primary.fk_application_has_functional_group_application1_"
+ "idx`; "
+ "DROP INDEX IF EXISTS "
+ "`app_group_non_primary.fk_application_has_functional_group_functional_"
+ "group1_idx`; "
+ "DROP TABLE IF EXISTS `app_group_non_primary`; "
+ "DROP TABLE IF EXISTS `interior_zone`; "
+ "DROP TABLE IF EXISTS `access_module`; "
+ "DROP INDEX IF EXISTS `access_module.zone_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 `app_group_primary`; "
+ "DELETE FROM `app_group_non_primary`; "
+ "DELETE FROM `interior_zone`; "
+ "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` = ?, `user_consent_passengersRC` = ?, "
+ "`country_consent_passengersRC` = ?";
+
+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`, "
+ " `user_consent_passengersRC` , `country_consent_passengersRC` "
+ " 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..48985fa835
--- /dev/null
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -0,0 +1,1880 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 < 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;
+ }
+ 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;
+ }
+ 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()) {
+ utils::dbms::SQLQuery query(db());
+ if (!messages.messages->empty()) {
+ 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;
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ 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) {
+ // 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;
+}
+
+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;
+ if (GatherAppGroup(kDefaultId, &default_groups) &&
+ SaveAppGroup(app_id, default_groups)) {
+ 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..8b7635c25c
--- /dev/null
+++ b/src/components/policy/policy_external/src/update_status_manager.cc
@@ -0,0 +1,260 @@
+/*
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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>())
+ , 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);
+ 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..8b77c90dd2
--- /dev/null
+++ b/src/components/policy/policy_external/test/CMakeLists.txt
@@ -0,0 +1,63 @@
+# 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)
+
+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_cache_manager.h b/src/components/policy/policy_external/test/include/policy/mock_cache_manager.h
new file mode 100644
index 0000000000..617e99358e
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_cache_manager.h
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_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&));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_CACHE_MANAGER_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..c958f6bcd7
--- /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)).Times(2);
+
+ // 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..ce34ca4400
--- /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_("storage1")
+ , 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..a0a544deeb
--- /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 = "storage1";
+ 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 = 35;
+ 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..76e10a58b0
--- /dev/null
+++ b/src/components/policy/policy_regular/CMakeLists.txt
@@ -0,0 +1,120 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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}")
+
+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/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h
new file mode 100644
index 0000000000..73c010ce33
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -0,0 +1,772 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
+
+ /**
+ * @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;
+
+#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:
+ 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_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..50896bb8f1
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
@@ -0,0 +1,644 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
+
+ /**
+ * @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_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..996c2917d0
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_helper.h
@@ -0,0 +1,248 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 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_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_listener.h b/src/components/policy/policy_regular/include/policy/policy_listener.h
new file mode 100644
index 0000000000..0170f421e4
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_listener.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_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_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;
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_LISTENER_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..3ca9994a8a
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -0,0 +1,380 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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"
+
+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 GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points);
+ virtual void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points);
+
+ virtual std::string GetLockScreenIconUrl() const;
+ virtual bool RequestPTUpdate();
+ virtual void CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
+ virtual bool ResetUserConsent();
+ virtual void KmsChanged(int kilometers);
+ virtual void IncrementIgnitionCycles();
+ virtual std::string ForcePTExchange();
+ virtual std::string ForcePTExchangeAtUserRequest();
+ virtual std::string GetPolicyTableStatus() const;
+ virtual void ResetRetrySequence();
+ virtual uint32_t NextRetryTimeout();
+ virtual uint32_t TimeoutExchangeMSec();
+ 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);
+
+ StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types);
+
+ 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) const OVERRIDE;
+ void set_cache_manager(CacheManagerInterface* cache_manager);
+
+ virtual void OnAppsSearchStarted();
+
+ virtual void OnAppsSearchCompleted(const bool trigger_ptu);
+
+#ifdef BUILD_TESTS
+ inline CacheManagerInterfaceSPtr GetCache() {
+ return cache_;
+ }
+
+ inline void SetSendOnUpdateSentOut(const bool send_on_update_sent_out) {
+ send_on_update_sent_out_ = send_on_update_sent_out;
+ }
+#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;
+
+ virtual bool HasCertificate() const OVERRIDE;
+
+ AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+
+ AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) 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 (msec)
+ */
+ 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;
+ friend struct ProccessAppGroups;
+
+ /**
+ * @brief Pair of app index and url index from Endpoints vector
+ * that contains all application URLs
+ */
+ RetrySequenceURL retry_sequence_url_;
+
+ bool wrong_ptu_update_received_;
+ bool send_on_update_sent_out_;
+ 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..0554e94722
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -0,0 +1,163 @@
+/*
+ * 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,
+};
+
+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_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..66fddee592
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h
@@ -0,0 +1,478 @@
+/*
+ * 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, 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;
+
+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;
+
+ 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;
+ 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..79a66ba41a
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
@@ -0,0 +1,125 @@
+/*
+ Copyright (c) 2013, " Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, " with or without
+ modification, " are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, " this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, "
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
+ CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR 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 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..bd867389ab
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
@@ -0,0 +1,203 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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:
+ 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..074e3c1eef
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/status.h
@@ -0,0 +1,198 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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
+};
+
+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..89c6b7e7bb
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h
@@ -0,0 +1,240 @@
+/*
+ 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
+ * @param update_timeout Timeout for waiting of incoming PTU (msec)
+ */
+ 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_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..e8da7b9b69
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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
+ * @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(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/app_stopwatch.h b/src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h
new file mode 100644
index 0000000000..8093c11467
--- /dev/null
+++ b/src/components/policy/policy_regular/include/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_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_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_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_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/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
new file mode 100644
index 0000000000..6184320306
--- /dev/null
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -0,0 +1,1636 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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/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_;
+};
+
+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_);
+}
+
+const policy_table::Strings& CacheManager::GetGroups(const PTString& app_id) {
+ 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);
+ 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;
+}
+
+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;
+ }
+ }
+}
+
+bool CacheManager::AppHasHMIType(const std::string& application_id,
+ policy_table::AppHMIType hmi_type) const {
+ 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();
+ 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 policy_table::Strings& groups,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+
+ 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;
+
+ 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);
+ 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 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();
+ 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 *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+}
+
+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::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);
+
+ 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;
+
+ 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> >();
+
+ 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()) {
+ 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;
+}
+
+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);
+ sync_primitives::AutoLock 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);
+ 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);
+ 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 {
+ // TODO(AOleynik): Maybe change for comparison with pre_DataConsent
+ // permissions or check string value from get_string()
+ 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) {
+ 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();
+ }
+ 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;
+}
+
+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);
+ 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();
+ 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(""));
+ 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_;
+}
+
+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/policy_regular/src/policy_helper.cc
index b72a041a83..b72a041a83 100644
--- a/src/components/policy/src/policy_helper.cc
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
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..bb7c68d22d
--- /dev/null
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -0,0 +1,1132 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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"
+
+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)
+ , 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());
+
+#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 int timeout_sec = NextRetryTimeout();
+ LOG4CXX_DEBUG(logger_,
+ "Start retry sequence timeout = " << timeout_sec);
+ timer_retry_sequence_.Start(timeout_sec, 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);
+}
+
+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.");
+
+ const policy_table::Strings& groups = cache_->GetGroups(app_id);
+ 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() {
+ 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::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() {
+ 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_);
+ 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");
+ 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.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/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
index 26c7b96b32..26c7b96b32 100644
--- a/src/components/policy/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
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..7928973919
--- /dev/null
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -0,0 +1,1389 @@
+// 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__);
+ 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 =
+ 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
+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 =
+ omitted_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 =
+ 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..e7a981e559
--- /dev/null
+++ b/src/components/policy/policy_regular/src/policy_table/validation.cc
@@ -0,0 +1,197 @@
+#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;
+}
+
+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_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/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc
index df4bc74cc2..df4bc74cc2 100644
--- a/src/components/policy/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
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..e94c853414
--- /dev/null
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -0,0 +1,1755 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 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/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..d683249718
--- /dev/null
+++ b/src/components/policy/policy_regular/src/update_status_manager.cc
@@ -0,0 +1,260 @@
+/*
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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>())
+ , 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();
+ 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();
+}
+
+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_regular/src/usage_statistics/counter.cc b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
new file mode 100644
index 0000000000..60e34a929d
--- /dev/null
+++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
@@ -0,0 +1,122 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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<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<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<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<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) {}
+
+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_regular/test/CMakeLists.txt b/src/components/policy/policy_regular/test/CMakeLists.txt
new file mode 100644
index 0000000000..997c3637e8
--- /dev/null
+++ b/src/components/policy/policy_regular/test/CMakeLists.txt
@@ -0,0 +1,71 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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/
+ ${POLICY_PATH}/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+)
+
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+
+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/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_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_cache_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h
new file mode 100644
index 0000000000..7569e2195d
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_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(GetPT, utils::SharedPtr<policy_table::Table>());
+ 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));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h b/src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h
new file mode 100644
index 0000000000..2e4073aae9
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h
@@ -0,0 +1,83 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_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&));
+ MOCK_CONST_METHOD1(GetRegisteredLinks,
+ void(std::map<std::string, std::string>&));
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h
new file mode 100644
index 0000000000..7ab4b518cd
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_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_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_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_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(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, 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,
+ StatusNotifier(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_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_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_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_MANAGER_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..981ff1ca9e
--- /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_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_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..e8bca3061f
--- /dev/null
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -0,0 +1,1367 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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"
+
+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;
+
+ 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, 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;
+ }
+};
+
+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())->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, 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())->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, 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..a313ce6d7f
--- /dev/null
+++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
@@ -0,0 +1,1709 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 {
+
+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(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<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());
+ // 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..910494ff0d
--- /dev/null
+++ b/src/components/policy/policy_regular/test/update_status_manager_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/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_;
+ const uint32_t k_timeout_;
+ utils::SharedPtr<MockPolicyListener> listener_;
+
+ public:
+ UpdateStatusManagerTest()
+ : manager_(utils::MakeShared<UpdateStatusManager>())
+ , k_timeout_(1000)
+ , 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(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_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_manager_impl.cc b/src/components/policy/src/policy_manager_impl.cc
deleted file mode 100644
index 4e3f892b45..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(), false);
- }
- }
- }
-}
-
-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, false);
-}
-
-} // namespace policy
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_representation.cc b/src/components/policy/src/sql_pt_representation.cc
deleted file mode 100644
index 4cf24672e0..0000000000
--- a/src/components/policy/src/sql_pt_representation.cc
+++ /dev/null
@@ -1,1752 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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
- 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());
- if (!set_not_first_run.Exec(sql_pt::kSetNotFirstRun)) {
- LOG4CXX_WARN(logger_, "Failed update is_first_run");
- }
- 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/src/usage_statistics/counter.cc b/src/components/policy/src/usage_statistics/counter.cc
deleted file mode 100644
index c5d7eaf9df..0000000000
--- a/src/components/policy/src/usage_statistics/counter.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#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<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<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<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<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) {}
-
-void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
- stopwatch_type_ = stopwatch_type;
- timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND, false);
-}
-
-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/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 1f4df5d15d..0000000000
--- a/src/components/policy/test/sql_pt_representation_test.cc
+++ /dev/null
@@ -1,1703 +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;
- // 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 = "storage1";
- file_system::RemoveDirectory(kAppStorageFolder);
- file_system::DeleteFile("policy.sqlite");
- reps = new SQLPTRepresentation;
- dbms = new DBMS(kDatabaseName);
- 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()));
- 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();
- 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";
-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;
-};
-
-// {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);
-}
-
-namespace {
-const std::string kAppStorageFolder = "storage";
-}
-
-TEST(SQLPTRepresentationTest3, Init_InitNewDataBase_ExpectResultSuccess) {
- // Arrange
- NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
- SQLPTRepresentation* reps;
- reps = new SQLPTRepresentation;
- // 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();
- delete reps;
-}
-
-TEST(SQLPTRepresentationTest3,
- Init_TryInitNotExistingDataBase_ExpectResultFail) {
- // Arrange
- NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
- ON_CALL(policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
- SQLPTRepresentation reps;
- (reps.db())->set_path("/home/");
- // 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));
- SQLPTRepresentation reps;
- 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(SQLPTRepresentationTest3, RemoveDB_RemoveDB_ExpectFileDeleted) {
- // Arrange
- policy_handler_test::MockPolicySettings policy_settings_;
- SQLPTRepresentation* reps = new SQLPTRepresentation;
- 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));
- delete reps;
-}
-
-// 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_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
index a09a565844..c1dd9b2769 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,22 +28,20 @@
# 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}
)
-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
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..b18ee07d4d 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
@@ -297,6 +297,16 @@ class ProtocolHandlerImpl
SessionObserver& get_session_observer() 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,
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/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/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
index 1a7be866d9..308901e013 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -36,7 +36,7 @@
#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 +44,7 @@
#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"
namespace test {
namespace components {
@@ -104,6 +105,10 @@ using ::testing::SetArgPointee;
typedef std::vector<uint8_t> UCharDataVector;
+namespace {
+const uint32_t kAsyncExpectationsTimeout = 10000u;
+}
+
class ProtocolHandlerImplTest : public ::testing::Test {
protected:
void InitProtocolHandlerImpl(const size_t period_msec,
@@ -156,8 +161,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 +175,14 @@ class ProtocolHandlerImplTest : public ::testing::Test {
std::string("BTMAC")),
connection_id);
}
- void AddSession() {
+
+ void AddSession(const ::utils::SharedPtr<TestAsyncWaiter>& waiter,
+ uint32_t& times) {
+ 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,6 +191,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
// use protection OFF
const bool callback_protection_flag = PROTECTION_OFF;
#endif // ENABLE_SECURITY
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -188,13 +201,15 @@ class ProtocolHandlerImplTest : public ::testing::Test {
_))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(session_id)));
+ 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);
@@ -206,6 +221,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,
@@ -327,6 +343,9 @@ TEST_F(ProtocolHandlerImplTest,
StartSession_Unprotected_SessionObserverReject) {
const int call_times = 5;
AddConnection();
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -338,14 +357,17 @@ TEST_F(ProtocolHandlerImplTest,
.Times(call_times)
.
// Return sessions start rejection
- WillRepeatedly(Return(SESSION_START_REJECT));
+ WillRepeatedly(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(SESSION_START_REJECT)));
+ 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 +379,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
@@ -375,6 +399,9 @@ 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;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -386,14 +413,17 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
.Times(call_times)
.
// Return sessions start rejection
- WillRepeatedly(Return(SESSION_START_REJECT));
+ WillRepeatedly(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(SESSION_START_REJECT)));
+ 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 +435,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
@@ -414,6 +446,9 @@ TEST_F(ProtocolHandlerImplTest,
StartSession_Unprotected_SessionObserverAccept) {
AddConnection();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -421,17 +456,21 @@ TEST_F(ProtocolHandlerImplTest,
connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ 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,7 +480,14 @@ 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));
}
// TODO(EZamakhov): add test for get_hash_id/set_hash_id from
// protocol_handler_impl.cc
@@ -449,7 +495,12 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) {
* 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
@@ -457,23 +508,33 @@ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) {
OnSessionEndedCallback(connection_id, session_id, _, 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
@@ -481,17 +542,21 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
OnSessionEndedCallback(connection_id, session_id, _, 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
@@ -500,7 +565,12 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
* Check session_observer with PROTECTION_OFF and Ack with PROTECTION_OFF
*/
TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
- AddConnection();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
// Add security manager
AddSecurityManager();
const ServiceType start_service = kRpc;
@@ -511,14 +581,17 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(session_id)));
+ 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,6 +602,8 @@ 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
@@ -539,6 +614,9 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
// Add security manager
AddSecurityManager();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -546,17 +624,21 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ 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
@@ -565,6 +647,9 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -572,23 +657,28 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ 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
@@ -599,6 +689,9 @@ TEST_F(ProtocolHandlerImplTest,
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -606,33 +699,42 @@ TEST_F(ProtocolHandlerImplTest,
connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ 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
@@ -642,6 +744,9 @@ TEST_F(ProtocolHandlerImplTest,
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -649,7 +754,8 @@ TEST_F(ProtocolHandlerImplTest,
connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ times++;
std::vector<int> services;
// TODO(AKutsan) : APPLINK-21398 use named constants instead of magic numbers
@@ -668,13 +774,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(_))
@@ -694,10 +802,13 @@ TEST_F(ProtocolHandlerImplTest,
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
@@ -714,6 +825,8 @@ 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,
@@ -721,52 +834,66 @@ TEST_F(ProtocolHandlerImplTest,
connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ 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
@@ -783,6 +910,8 @@ 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,
@@ -790,13 +919,16 @@ TEST_F(
connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ 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 +940,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
@@ -851,6 +993,8 @@ 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,
@@ -858,28 +1002,35 @@ TEST_F(ProtocolHandlerImplTest,
connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ 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 +1054,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 +1098,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 +1122,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 +1135,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 +1164,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 +1193,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 +1222,8 @@ TEST_F(ProtocolHandlerImplTest, FloodVerificationDisable) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) {
@@ -1036,7 +1231,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 +1255,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 +1302,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 +1375,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedStock) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) {
@@ -1165,7 +1384,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 +1436,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) {
// No common message
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) {
@@ -1219,7 +1445,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 +1470,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 +1504,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullCount) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest,
@@ -1275,13 +1516,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 +1542,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 +1565,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 +1581,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 +1604,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 +1630,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 +1666,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 +1689,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 +1701,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 +1727,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 +1771,41 @@ 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));
}
} // namespace protocol_handler_test
diff --git a/src/components/qt_hmi/test/CMakeLists.txt b/src/components/qt_hmi/test/CMakeLists.txt
index b0c48a4348..91ec2cd20c 100644
--- a/src/components/qt_hmi/test/CMakeLists.txt
+++ b/src/components/qt_hmi/test/CMakeLists.txt
@@ -29,8 +29,6 @@
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
-
cmake_minimum_required(VERSION 2.8.11)
set(QT_HMI_TESTS_LIST
@@ -67,4 +65,3 @@ 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/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 cf14526541..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;
@@ -674,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 31f8c90872..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)
@@ -385,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
index 941c8f61cc..4397112d54 100644
--- a/src/components/rpc_base/include/rpc_base/validation_report.h
+++ b/src/components/rpc_base/include/rpc_base/validation_report.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RPC_BASE_VALIDATION_REPORT_H_
-#define RPC_BASE_VALIDATION_REPORT_H_
+#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>
@@ -119,4 +119,4 @@ inline std::string PrettyFormat(const ValidationReport& report) {
} // namespace rpc
-#endif /* RPC_BASE_VALIDATION_REPORT_H_ */
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_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..566f0ddcde 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,8 +28,9 @@
# 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
@@ -43,20 +44,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..c4ffbc321e 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 {
@@ -435,4 +437,6 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedMap2) {
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..596bfdb20d 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 {
@@ -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/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..7fef33f1df 100644
--- a/src/components/security_manager/test/crypto_manager_impl_test.cc
+++ b/src/components/security_manager/test/crypto_manager_impl_test.cc
@@ -91,7 +91,6 @@ class CryptoManagerTest : public testing::Test {
void TearDown() OVERRIDE {
delete mock_security_manager_settings_;
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
}
void InitSecurityManager() {
diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc
index b5f9ae2e78..1178efbc0d 100644
--- a/src/components/security_manager/test/security_manager_test.cc
+++ b/src/components/security_manager/test/security_manager_test.cc
@@ -44,6 +44,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 +73,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 +89,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:
@@ -96,10 +100,6 @@ class SecurityManagerTest : public ::testing::Test {
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);
- }
void SetMockCryptoManager() {
EXPECT_CALL(mock_crypto_manager, IsCertificateUpdateRequired())
@@ -268,7 +268,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 +278,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 +357,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
@@ -608,7 +620,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 +632,55 @@ 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,
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));
}
/*
* Shall send InternallError on getting
@@ -668,29 +695,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,
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 +737,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 +759,8 @@ 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));
}
/*
* Shall send HandshakeData on getting SEND_HANDSHAKE_DATA from mobile side
@@ -729,31 +773,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,
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 +821,18 @@ 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));
}
/*
* Shall call all listeners on success end handshake
@@ -781,19 +843,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,
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 +874,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 +911,19 @@ 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));
}
/*
* Shall not any query on getting empty SEND_INTERNAL_ERROR
diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc
index b35da3fc61..9223a74505 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.p12.enc",
+ server_certificate_data_base64_);
+ SetCertificate("client/client_credential_unsigned.p12.enc",
+ 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/smart_object.h b/src/components/smart_objects/include/smart_objects/smart_object.h
index 688550b040..98e58fffd1 100644
--- a/src/components/smart_objects/include/smart_objects/smart_object.h
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -1016,4 +1016,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/test/AlwaysFalseSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
index cf1d107ba2..85615d4911 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;
/**
@@ -88,7 +88,7 @@ TEST(test_AlwaysFalseSchemaItemTest, simple_test) {
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..7a87108cb0 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;
@@ -89,7 +88,7 @@ TEST(test_AlwaysTrueSchemaItemTest, simple_test) {
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..fa42813f8d 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
@@ -339,7 +338,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..8e39af8e08 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;
/**
@@ -209,7 +209,7 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
resultType = item->validate(obj);
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..7dd63ae6eb 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 {
@@ -401,16 +400,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 +442,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..e5ac013f86 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 {
@@ -228,10 +227,10 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
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..c9e183ca4a 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;
@@ -820,7 +819,6 @@ TEST(test_double_int_value, test_NumberSchemaItemTest) {
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..d19d8518fe 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
@@ -305,7 +304,7 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
resultType = item->validate(obj);
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..bb33857ecd 100644
--- a/src/components/telemetry_monitor/CMakeLists.txt
+++ b/src/components/telemetry_monitor/CMakeLists.txt
@@ -28,17 +28,20 @@
# 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/
+ ${POLICY_PATH}/include/
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
+ ${COMPONENTS_DIR}/rpc_base/include/
${COMPONENTS_DIR}/hmi_message_handler/include/
${COMPONENTS_DIR}/formatters/include/
${COMPONENTS_DIR}/media_manager/include/
@@ -49,15 +52,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..ba8cbceb23 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
@@ -30,8 +30,8 @@
* 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>
@@ -105,4 +105,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/test/CMakeLists.txt b/src/components/telemetry_monitor/test/CMakeLists.txt
index 7d2de19854..d72b89f0e1 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.16)
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..5043524a06 100644
--- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
+++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
@@ -101,6 +101,6 @@ TEST(TelemetryMonitorTest, MessageProcess) {
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..8c7980a96a 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,69 @@ 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
+ )
+ list(APPEND LIBRARIES
+ Libusb-1.0.16
)
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)
-
-
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+else()
+ list(APPEND EXCLUDE_PATHS
+ ${COMPONENTS_DIR}/transport_manager/include/transport_manager/usb
+ ${COMPONENTS_DIR}/transport_manager/src/usb
+ )
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)
+ target_link_libraries("TransportManager" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
-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/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_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 3dedead540..d4c97d5233 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
@@ -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
@@ -414,6 +414,18 @@ class TransportAdapterImpl : public TransportAdapter,
*/
std::string GetConnectionType() const OVERRIDE;
+ /**
+ * @brief RunAppOnDevice allows run specific application on the certain
+ *device.
+ *
+ * @param device_handle device identifier to run application on.
+ *
+ * @param bundle_id application id also known as bundle id on some devices to
+ *run.
+ */
+ void RunAppOnDevice(const DeviceUID& device_uid,
+ const std::string& bundle_id) OVERRIDE;
+
#ifdef TELEMETRY_MONITOR
/**
* @brief Setup observer for time metric.
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..a7cd544563 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
@@ -291,4 +291,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 289df3535d..4dd74086be 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
@@ -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
@@ -181,6 +181,18 @@ class TransportManagerImpl
const protocol_handler::RawMessagePtr message) OVERRIDE;
/**
+ * @brief RunAppOnDevice allows to run specific application on the certain
+ *device.
+ *
+ * @param device_handle device identifier to run application on.
+ *
+ * @param bundle_id application id also known as bundle id on some devices to
+ *run.
+ */
+ void RunAppOnDevice(const DeviceHandle device_handle,
+ const std::string& bundle_id) OVERRIDE;
+
+ /**
* @brief Post event in the event queue.
*
* @param event Current event information.
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_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
index ad000ab901..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_);
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/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
index 6458310da8..52a566c5ff 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"
@@ -241,12 +242,16 @@ void TcpClientListener::Loop() {
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);
}
}
}
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_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 35518eae91..135babdeb0 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,12 +163,12 @@ 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");
@@ -191,6 +197,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_);
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 5638eecdee..026e53670b 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
@@ -192,6 +192,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 =
@@ -751,21 +755,20 @@ void TransportAdapterImpl::ConnectFailed(const DeviceUID& device_handle,
void TransportAdapterImpl::RemoveFinalizedConnection(
const DeviceUID& device_handle, const ApplicationHandle& app_handle) {
const DeviceUID device_uid = device_handle;
- const ApplicationHandle app_uid = app_handle;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoWriteLock lock(connections_lock_);
ConnectionMap::iterator it_conn =
connections_.find(std::make_pair(device_uid, app_handle));
if (it_conn == connections_.end()) {
LOG4CXX_WARN(logger_,
- "Device_id: " << &device_uid << ", app_handle: " << &app_uid
+ "Device_id: " << &device_uid << ", app_handle: " << &app_handle
<< " connection not found");
return;
}
const ConnectionInfo& info = it_conn->second;
if (info.state != ConnectionInfo::FINALISING) {
LOG4CXX_WARN(logger_,
- "Device_id: " << &device_uid << ", app_handle: " << &app_uid
+ "Device_id: " << &device_uid << ", app_handle: " << &app_handle
<< " connection not finalized");
return;
}
@@ -952,6 +955,21 @@ TransportAdapter::Error TransportAdapterImpl::ConnectDevice(DeviceSptr device) {
}
}
+void TransportAdapterImpl::RunAppOnDevice(const DeviceUID& device_uid,
+ const std::string& bundle_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ DeviceSptr device = FindDevice(device_uid);
+ if (!device) {
+ LOG4CXX_WARN(logger_,
+ "Device with id: " << device_uid << " Not found"
+ << "withing list of connected deviced");
+ return;
+ }
+
+ device->LaunchApp(bundle_id);
+}
+
void TransportAdapterImpl::RemoveDevice(const DeviceUID& device_handle) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Device_handle: " << &device_handle);
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index 113d280c8d..433885a606 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
@@ -341,6 +341,34 @@ int TransportManagerImpl::SendMessageToDevice(
return E_SUCCESS;
}
+void TransportManagerImpl::RunAppOnDevice(const DeviceHandle device_handle,
+ const std::string& bundle_id) {
+ if (!this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TransportManager is not initialized.");
+ return;
+ }
+ DeviceUID device_id = converter_.HandleToUid(device_handle);
+ LOG4CXX_DEBUG(logger_, "Convert handle to id:" << device_id);
+
+ sync_primitives::AutoReadLock lock(device_to_adapter_map_lock_);
+ DeviceToAdapterMap::iterator it = device_to_adapter_map_.find(device_id);
+ if (it == device_to_adapter_map_.end()) {
+ LOG4CXX_ERROR(logger_, "No device adapter found by id " << device_id);
+ return;
+ }
+ transport_adapter::TransportAdapter* ta = it->second;
+
+ if (!ta) {
+ LOG4CXX_ERROR(logger_,
+ "Transport adapter for device: " << device_id << " is NULL");
+ return;
+ }
+
+ ta->RunAppOnDevice(device_id, bundle_id);
+
+ return;
+}
+
int TransportManagerImpl::ReceiveEventFromDevice(
const TransportAdapterEvent& event) {
LOG4CXX_TRACE(logger_, "enter. TransportAdapterEvent: " << &event);
@@ -385,14 +413,17 @@ int TransportManagerImpl::AddTransportAdapter(
"transport_adapter_listeners_.end()");
return E_ADAPTER_EXISTS;
}
- transport_adapter_listeners_[transport_adapter] =
- new TransportAdapterListenerImpl(this, transport_adapter);
- transport_adapter->AddListener(
- transport_adapter_listeners_[transport_adapter]);
if (transport_adapter->IsInitialised() ||
transport_adapter->Init() == TransportAdapter::OK) {
+ transport_adapter_listeners_[transport_adapter] =
+ new TransportAdapterListenerImpl(this, transport_adapter);
+ transport_adapter->AddListener(
+ transport_adapter_listeners_[transport_adapter]);
+
transport_adapters_.push_back(transport_adapter);
+ } else {
+ delete transport_adapter;
}
LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
return E_SUCCESS;
@@ -590,22 +621,29 @@ void TransportManagerImpl::AddConnection(const ConnectionInternal& c) {
connections_.push_back(c);
}
+namespace {
+struct ConnectionFinder {
+ const uint32_t id_;
+ ConnectionFinder(const uint32_t id) : id_(id) {}
+ bool operator()(const transport_manager::TransportManagerImpl::Connection&
+ connection) const {
+ return id_ == connection.id;
+ }
+};
+}
+
void TransportManagerImpl::RemoveConnection(
const uint32_t id, transport_adapter::TransportAdapter* transport_adapter) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Id: " << id);
sync_primitives::AutoWriteLock lock(connections_lock_);
- 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;
+ 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);
}
}
@@ -665,7 +703,6 @@ void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) {
device_infos.push_back(it->second);
}
device_list_lock_.Release();
- RaiseEvent(&TransportManagerListener::OnDeviceListUpdated, device_infos);
LOG4CXX_TRACE(logger_, "exit");
}
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..184d546f15 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
@@ -58,20 +63,11 @@ if (BUILD_USB_SUPPORT)
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 aac28fac11..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/device_mock.h
+++ /dev/null
@@ -1,70 +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_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..0636448e58 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;
@@ -71,7 +71,7 @@ class MockTransportAdapterImpl : public TransportAdapterImpl {
virtual ~MockTransportAdapterImpl(){};
virtual DeviceType GetDeviceType() const {
- return UNKNOWN;
+ return DeviceType::UNKNOWN;
}
MOCK_CONST_METHOD0(Store, void());
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..8302a63beb
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
@@ -0,0 +1,129 @@
+/*
+ * \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&));
+};
+
+} // 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 d12741f49a..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h
+++ /dev/null
@@ -1,108 +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_MOCK_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_MOCK_H_
-
-#include "gmock/gmock.h"
-#include "transport_manager/transport_adapter/transport_adapter.h"
-
-namespace test {
-namespace components {
-namespace transport_manager_test {
-
-class 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_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_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/smartDeviceLink_test.ini b/src/components/transport_manager/test/smartDeviceLink_test.ini
index 40aeb5a019..6fc8ab63ec 100644
--- a/src/components/transport_manager/test/smartDeviceLink_test.ini
+++ b/src/components/transport_manager/test/smartDeviceLink_test.ini
@@ -53,3 +53,18 @@ ResumptionDelayAfterIgn = 30;
# Resumption ctrl uses JSON if UseDBForResumption=false for store data otherwise uses DB
UseDBForResumption = false
+[AppLaunch]
+; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
+AppLaunchWaitTime = 5000
+; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
+AppLaunchMaxRetryAttempt = 3
+; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
+AppLaunchRetryWaitTime = 15000
+; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
+RemoveBundleIDattempts = 3
+; the maximum number of iOS devices for which entries can be remembered by SDL
+MaxNumberOfiOSDevice = 10
+; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
+WaitTimeBetweenApps = 4000
+; App Launch on iOS devices SDL feature enabler/disabler
+EnableAppLaunchIOS = true
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..c8e9af7d63 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 {
diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc
index 5d34a2f02f..0c59e912ba 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 {
@@ -54,6 +54,7 @@ namespace components {
namespace transport_manager_test {
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::_;
using ::testing::NiceMock;
using namespace ::transport_manager;
@@ -73,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;
@@ -158,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));
@@ -739,6 +740,39 @@ TEST_F(TransportAdapterTest, FindEstablishedConnection) {
EXPECT_CALL(*serverMock, Terminate());
}
+TEST_F(TransportAdapterTest, RunAppOnDevice_NoDeviseWithAskedId_UNSUCCESS) {
+ const std::string bundle_id = "test_bundle_id";
+
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+
+ utils::SharedPtr<MockDevice> mock_device =
+ utils::MakeShared<MockDevice>("test_device_name", "test_device_uid0");
+
+ transport_adapter.AddDevice(mock_device);
+
+ EXPECT_CALL(*mock_device, LaunchApp(bundle_id)).Times(0);
+
+ transport_adapter.RunAppOnDevice("test_device_uid1", bundle_id);
+}
+
+TEST_F(TransportAdapterTest, RunAppOnDevice_DeviseWithAskedIdWasFound_SUCCESS) {
+ const std::string bundle_id = "test_bundle_id";
+ const std::string device_uid = "test_device_uid";
+
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+
+ utils::SharedPtr<MockDevice> mock_device =
+ utils::MakeShared<MockDevice>("test_device_name", device_uid);
+
+ transport_adapter.AddDevice(mock_device);
+
+ EXPECT_CALL(*mock_device, LaunchApp(bundle_id));
+
+ transport_adapter.RunAppOnDevice(device_uid, bundle_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..0d8e574317 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,83 @@
* 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 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);
+
+ 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] = "57.48.0.1";
+ tcp_device[kDeviceApplications][0][kApplicationPort] = kApplicationPortValue;
+ Json::Value bluetooth_device;
+ bluetooth_device[kDeviceName] = "unique_bluetooth_device_name";
+ bluetooth_device[kDeviceAddress] = "57.48.0.2";
+ bluetooth_device[kDeviceApplications][0][kApplicationPort] =
+ kApplicationPortValue;
+ 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));
- transport_manager.Init(last_state);
+ 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 ddfd827358..14362050a2 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,23 +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;
@@ -62,9 +61,11 @@ 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:
@@ -75,10 +76,11 @@ class TransportManagerImplTest : public ::testing::Test {
, dev_info_(device_handle_, mac_address_, "TestDeviceName", "BTMAC") {}
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_);
@@ -125,7 +127,6 @@ class TransportManagerImplTest : public ::testing::Test {
EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
- EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(vector_dev_info));
tm_.TestHandle(test_event);
device_list_.pop_back();
@@ -318,10 +319,8 @@ class TransportManagerImplTest : public ::testing::Test {
#endif // TELEMETRY_MONITOR
MockTransportAdapter* mock_adapter_;
- utils::SharedPtr<TransportManagerListenerMock> tm_listener_;
-
+ utils::SharedPtr<MockTransportManagerListener> tm_listener_;
const ApplicationHandle application_id_ = 1;
-
ConnectionUID connection_key_;
RawMessagePtr test_message_;
DeviceHandle device_handle_;
@@ -492,83 +491,104 @@ 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) {
// Arrange
HandleConnection();
- MockTMTelemetryObserver* mock_metric_observer = new MockTMTelemetryObserver();
- tm_.SetTelemetryObserver(mock_metric_observer);
- EXPECT_CALL(*mock_metric_observer, StartRawMsg(_));
+#ifdef TELEMETRY_MONITOR
+ 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
- EXPECT_CALL(*mock_metric_observer, StopRawMsg(_)).Times(0);
-
- delete mock_metric_observer;
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, SendMessageToDevice_StartTimeObserver) {
// Arrange
HandleConnection();
- MockTMTelemetryObserver* mock_metric_observer = new MockTMTelemetryObserver();
- tm_.SetTelemetryObserver(mock_metric_observer);
+ TestAsyncWaiter waiter;
EXPECT_CALL(*mock_adapter_,
SendData(mac_address_, application_id_, test_message_))
- .WillOnce(Return(TransportAdapter::OK));
- EXPECT_CALL(*mock_metric_observer, StartRawMsg(_));
+ .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_));
- delete mock_metric_observer;
- 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) {
@@ -659,6 +679,7 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceDone) {
const int type = static_cast<int>(
TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
+ TestAsyncWaiter waiter;
TransportAdapterEvent test_event(type,
mock_adapter_,
mac_address_,
@@ -666,16 +687,19 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceDone) {
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);
+ TestAsyncWaiter waiter;
TransportAdapterEvent test_event(type,
mock_adapter_,
mac_address_,
@@ -683,10 +707,12 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceFail) {
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) {
@@ -703,6 +729,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_));
@@ -713,13 +740,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) {
@@ -877,10 +906,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) {
@@ -1068,6 +1101,13 @@ TEST_F(TransportManagerImplTest,
tm_.TestHandle(test_event);
}
+TEST_F(TransportManagerImplTest, RunAppOnDevice_TransportAdapterFound_SUCCESS) {
+ HandleDeviceListUpdated();
+ const std::string bundle_id = "test_bundle_id";
+ EXPECT_CALL(*mock_adapter_, RunAppOnDevice(mac_address_, bundle_id));
+ tm_.RunAppOnDevice(device_handle_, bundle_id);
+}
+
} // 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/helpers.h b/src/components/utils/include/utils/helpers.h
index 17d4af27a1..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.
@@ -117,6 +117,15 @@ bool Compare(T what, T to, T to1, T to2, T to3, T to4) {
Compare<T, CompareType, CmpStrategy>(what, to4));
}
+template <typename T,
+ bool (*CompareType)(T, T),
+ bool (*CmpStrategy)(bool, bool)>
+bool Compare(T what, T to, T to1, T to2, T to3, T to4, T to5) {
+ return CmpStrategy(
+ Compare<T, CompareType, CmpStrategy>(what, to, to1, to2, to3),
+ Compare<T, CompareType, CmpStrategy>(what, to4, to5));
+}
+
template <typename Container>
bool in_range(const Container& container,
const typename Container::value_type& value) {
@@ -125,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/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 720628ef3c..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"
@@ -131,6 +131,11 @@ class SQLDatabase {
sync_primitives::Lock conn_lock_;
/**
+ * The file path of database
+ */
+ std::string path_;
+
+ /**
* The filename of database
*/
std::string databasename_;
@@ -164,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/include/utils/timer.h b/src/components/utils/include/utils/timer.h
index 690c9df5dc..ab3d48ef6f 100644
--- a/src/components/utils/include/utils/timer.h
+++ b/src/components/utils/include/utils/timer.h
@@ -47,6 +47,23 @@ namespace timer {
typedef uint32_t Milliseconds;
/**
+ * @brief Enumeration listing of possible timer types.
+ * Single shot timer signals only once and then stops counting.
+ * Periodic timer signals every time specific value is reached
+ * and then restarts.
+ */
+enum TimerType {
+ /**
+ * @brief Periodic calls to task
+ */
+ kPeriodic = 0,
+ /**
+ * @brief Single call to task
+ */
+ kSingleShot = 1
+};
+
+/**
* @brief Timer calls custom callback function after
* specified timeout has been elapsed.
* Thread-safe class
@@ -70,9 +87,9 @@ class Timer {
/**
* @brief Starts timer with specified timeout
* @param timeout Timer timeout
- * @param single_shot Single shot flag for timer
+ * @param enum timer_type Timer type enum value.
*/
- void Start(const Milliseconds timeout, const bool single_shot);
+ void Start(const Milliseconds timeout, const TimerType timer_type);
/**
* @brief Stops timer if it's running
diff --git a/src/components/utils/src/custom_string.cc b/src/components/utils/src/custom_string.cc
index e7fc4cfd6a..8254a98180 100644
--- a/src/components/utils/src/custom_string.cc
+++ b/src/components/utils/src/custom_string.cc
@@ -37,6 +37,7 @@
#include <cwctype>
#include <new>
#include <algorithm>
+#include <vector>
#include <string.h>
#include "utils/logger.h"
#include "utils/macro.h"
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/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 bf19275bac..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 {
@@ -53,7 +53,10 @@ bool SQLDatabase::Open() {
sync_primitives::AutoLock auto_lock(conn_lock_);
if (conn_)
return true;
- error_ = sqlite3_open(databasename_.c_str(), &conn_);
+ error_ = sqlite3_open(get_path().c_str(), &conn_);
+ if (error_ != SQLITE_OK) {
+ conn_ = NULL;
+ }
return error_ == SQLITE_OK;
}
@@ -101,11 +104,11 @@ sqlite3* SQLDatabase::conn() const {
}
void SQLDatabase::set_path(const std::string& path) {
- databasename_ = path + databasename_;
+ path_ = path;
}
std::string SQLDatabase::get_path() const {
- return databasename_;
+ return path_ + databasename_;
}
bool SQLDatabase::Backup() {
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/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 00272a73eb..642f16e574 100644
--- a/src/components/utils/src/timer.cc
+++ b/src/components/utils/src/timer.cc
@@ -71,11 +71,22 @@ timer::Timer::~Timer() {
LOG4CXX_DEBUG(logger_, "Timer " << name_ << " has been destroyed");
}
-void timer::Timer::Start(const Milliseconds timeout, const bool single_shot) {
+void timer::Timer::Start(const Milliseconds timeout,
+ const TimerType timer_type) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock auto_lock(state_lock_);
StopThread();
- single_shot_ = single_shot;
+ switch (timer_type) {
+ case kSingleShot: {
+ single_shot_ = true;
+ break;
+ }
+ case kPeriodic: {
+ single_shot_ = false;
+ break;
+ }
+ default: { ASSERT("timer_type should be kSingleShot or kPeriodic"); }
+ };
StartDelegate(timeout);
StartThread();
LOG4CXX_DEBUG(logger_, "Timer " << name_ << " has been started");
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..3dd6383588 100644
--- a/src/components/utils/test/async_runner_test.cc
+++ b/src/components/utils/test/async_runner_test.cc
@@ -41,7 +41,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using namespace sync_primitives;
using namespace threads;
@@ -135,6 +135,6 @@ TEST_F(AsyncRunnerTest,
EXPECT_EQ(kDelegatesNum_ / 2, check_value);
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
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..86c9dfa2e0 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:
@@ -127,6 +127,6 @@ TEST_F(
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..d37b46f801 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:
@@ -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..efaaa41252 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;
@@ -261,6 +261,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/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..85abbd90de 100644
--- a/src/components/utils/test/scope_guard_test.cc
+++ b/src/components/utils/test/scope_guard_test.cc
@@ -36,7 +36,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using ::utils::ScopeGuard;
using ::utils::MakeGuard;
@@ -116,6 +116,6 @@ TEST(ScopeGuardTest, DismissCallObjectFunctionWithParam) {
}
}
-} // 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..a30f2f66eb 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) {}
@@ -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..b481e45fd3 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:
@@ -374,7 +374,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 170fb3f10b..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_CURRENT_SOURCE_DIR}/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 MOBILE_API.xml 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/MOBILE_API.xml b/src/components/utils/test/test_generator/MOBILE_API.xml
deleted file mode 100644
index 01ea48dce9..0000000000
--- a/src/components/utils/test/test_generator/MOBILE_API.xml
+++ /dev/null
@@ -1,4999 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-
-<interface name="Ford Sync RAPI" version="3.1" date="2015-11-13">
-
- <enum name="Result" internal_scope="base">
- <element name="SUCCESS">
- <description>The request succeeded</description>
- </element>
- <element name="UNSUPPORTED_REQUEST">
- <description>The request is not supported by Sync</description>
- </element>
- <element name="UNSUPPORTED_RESOURCE">
- <description>
- A button that was requested for subscription is not supported under the current system.
- NOTE: could become a more generic UNSUPPORTED_RESOURCE by merging with VEHIVLE_DATA_NOT_AVAILABLE.
- </description>
- </element>
- <element name="DISALLOWED">
- <description>RPC is not authorized in local policy table.</description>
- </element>
- <element name="REJECTED">
- <description>
- The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
- Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
- </description>
- </element>
- <element name="ABORTED">
- <description>
- A command was aborted, for example due to user interaction (e.g. user pressed button).
- Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
- </description>
- </element>
- <element name="IGNORED">
- <description>
- A command was ignored, because the intended result is already in effect.
- For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
- NOTE: potentially replaces SUBSCRIBED_ALREADY
- </description>
- </element>
- <element name="RETRY">
- <description>The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.</description>
- </element>
- <element name="IN_USE">
- <description>
- The data may not be changed, because it is currently in use.
- For example when trying to delete a command set that is currently involved in an interaction.
- </description>
- </element>
- <element name="VEHICLE_DATA_NOT_AVAILABLE">
- <description>The requested vehicle data is not available on this vehicle or is not published.</description>
- </element>
- <element name="TIMED_OUT">
- <description>Overlay reached the maximum timeout and closed.</description>
- </element>
- <element name="INVALID_DATA">
- <description>
- The data sent is invalid. For example:
- Invalid Json syntax
- Parameters out of bounds (number or enum range)
- Mandatory parameters not provided
- Parameter provided with wrong type
- Invalid characters
- Empty string
- </description>
- </element>
- <element name="CHAR_LIMIT_EXCEEDED"/>
- <element name="INVALID_ID">
- <description>
- One of the provided IDs is not valid. For example
- This applies to CorrelationID, SubscriptionID [@TODO if SubscriptionID is used], CommandID, MenuID, [@TODO: missed one?]
- </description>
- </element>
- <element name="DUPLICATE_NAME">
- <description>There was a conflict with an registered name (application or menu item) or vr command</description>
- </element>
- <element name="APPLICATION_NOT_REGISTERED">
- <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
- </element>
- <element name="WRONG_LANGUAGE">
- <description>
- The requested language is currently not supported.
- Might be because of a mismatch of the currently active language on Sync and the requested language
- </description>
- </element>
- <element name="OUT_OF_MEMORY">
- <description>The system could not process the request because the necessary memory couldn't be allocated</description>
- </element>
- <element name="TOO_MANY_PENDING_REQUESTS">
- <description>There are too many requests pending (means, that the response has not been delivered, yet).</description>
- <designdescription>There may be a maximum of 1000 pending requests at a time.</designdescription>
- </element>
- <element name="TOO_MANY_APPLICATIONS">
- <description>There are already too many registered applications</description>
- </element>
- <element name="APPLICATION_REGISTERED_ALREADY">
- <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
- </element>
- <element name="WARNINGS">
- <description>The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.</description>
- </element>
- <element name="GENERIC_ERROR">
- <description>Provided data is valid but something went wrong in the lower layers.</description>
- </element>
- <element name="USER_DISALLOWED">
- <description>RPC is included in a functional group explicitly blocked by the user.</description>
- </element>
- <element name="UNSUPPORTED_VERSION">
- <description>Sync doesn't support the protocol that is requested by the mobile application</description>
- </element>
- <element name="VEHICLE_DATA_NOT_ALLOWED">
- <description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
- </element>
- <element name="FILE_NOT_FOUND">
- <description>A specified file could not be found on Sync.</description>
- </element>
- <element name="CANCEL_ROUTE">
- <description>User selected to Cancel Route.</description>
- </element>
- <element name="TRUNCATED_DATA">
- <description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
- </element>
- <element name="SAVED">
- <description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
- </element>
- <element name="INVALID_CERT">
- <description>The certificate provided during authentication is invalid.</description>
- </element>
- <element name="EXPIRED_CERT">
- <description>The certificate provided during authentication is expired.</description>
- </element>
- <element name="RESUME_FAILED">
- <description>The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.</description>
- </element>
- </enum>
-
- <enum name="ButtonPressMode">
- <element name="LONG">
- <description>
- A button was released, after it was pressed for a long time
- Actual timing is defined by Sync and may vary
- </description>
- </element>
- <element name="SHORT">
- <description>
- A button was released, after it was pressed for a short time
- Actual timing is defined by Sync and may vary
- </description>
- </element>
- </enum>
-
- <enum name="ButtonEventMode">
- <element name="BUTTONUP">
- <description>A button has been released up</description>
- </element>
- <element name="BUTTONDOWN">
- <description>A button has been pressed down</description>
- </element>
- </enum>
-
- <enum name="Language">
- <element name="EN-US" internal_name="EN_US">
- <description>English - US</description>
- </element>
- <element name="ES-MX" internal_name="ES_MX">
- <description>Spanish - Mexico</description>
- </element>
- <element name="FR-CA" internal_name="FR_CA">
- <description>French - Canada</description>
- </element>
- <element name="DE-DE" internal_name="DE_DE">
- <description>German - Germany</description>
- </element>
- <element name="ES-ES" internal_name="ES_ES">
- <description>Spanish - Spain</description>
- </element>
- <element name="EN-GB" internal_name="EN_GB">
- <description>English - GB</description>
- </element>
- <element name="RU-RU" internal_name="RU_RU">
- <description>Russian - Russia</description>
- </element>
- <element name="TR-TR" internal_name="TR_TR">
- <description>Turkish - Turkey</description>
- </element>
- <element name="PL-PL" internal_name="PL_PL">
- <description>Polish - Poland</description>
- </element>
- <element name="FR-FR" internal_name="FR_FR">
- <description>French - France</description>
- </element>
- <element name="IT-IT" internal_name="IT_IT">
- <description>Italian - Italy</description>
- </element>
- <element name="SV-SE" internal_name="SV_SE">
- <description>Swedish - Sweden</description>
- </element>
- <element name="PT-PT" internal_name="PT_PT">
- <description>Portuguese - Portugal</description>
- </element>
- <element name="NL-NL" internal_name="NL_NL">
- <description>Dutch (Standard) - Netherlands</description>
- </element>
- <element name="EN-AU" internal_name="EN_AU">
- <description>English - Australia</description>
- </element>
- <element name="ZH-CN" internal_name="ZH_CN">
- <description>Mandarin - China</description>
- </element>
- <element name="ZH-TW" internal_name="ZH_TW">
- <description>Mandarin - Taiwan</description>
- </element>
- <element name="JA-JP" internal_name="JA_JP">
- <description>Japanese - Japan</description>
- </element>
- <element name="AR-SA" internal_name="AR_SA">
- <description>Arabic - Saudi Arabia</description>
- </element>
- <element name="KO-KR" internal_name="KO_KR">
- <description>Korean - South Korea</description>
- </element>
- <element name="PT-BR" internal_name="PT_BR">
- <description>Portuguese - Brazil</description>
- </element>
- <element name="CS-CZ" internal_name="CS_CZ">
- <description>Czech - Czech Republic</description>
- </element>
- <element name="DA-DK" internal_name="DA_DK">
- <description>Danish - Denmark</description>
- </element>
- <element name="NO-NO" internal_name="NO_NO">
- <description>Norwegian - Norway</description>
- </element>
- <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>
- <element name="USER_EXIT" />
- <element name="IGNITION_OFF" />
- <element name="BLUETOOTH_OFF" />
- <element name="USB_DISCONNECTED" />
- <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL" />
- <element name="TOO_MANY_REQUESTS" />
- <element name="DRIVER_DISTRACTION_VIOLATION" />
- <element name="LANGUAGE_CHANGE" />
- <element name="MASTER_RESET" />
- <element name="FACTORY_DEFAULTS" />
- <element name="APP_UNAUTHORIZED" />
- <element name="PROTOCOL_VIOLATION" />
- </enum>
-
- <enum name="TriggerSource">
- <description>Indicates the source from where the command was triggered.</description>
- <element name="MENU" internal_name="TS_MENU" />
- <element name="VR" internal_name="TS_VR" />
- <element name="KEYBOARD" internal_name="TS_KEYBOARD" />
- </enum>
-
- <enum name="HmiZoneCapabilities">
- <description>Contains information about the HMI zone capabilities.</description>
- <description>For future use.</description>
- <element name="FRONT" />
- <element name="BACK" />
- </enum>
-
- <enum name="SpeechCapabilities">
- <description>Contains information about the TTS capabilities.</description>
- <element name="TEXT" internal_name="SC_TEXT"/>
- <element name="SAPI_PHONEMES" />
- <element name="LHPLUS_PHONEMES" />
- <element name="PRE_RECORDED" />
- <element name="SILENCE" />
- </enum>
-
- <enum name="VrCapabilities">
- <description>Contains information about the VR capabilities.</description>
- <element name="TEXT" internal_name="VR_TEXT"/>
- </enum>
-
- <enum name="PrerecordedSpeech">
- <description>Contains a list of prerecorded speech items present on the platform.</description>
- <element name="HELP_JINGLE" />
- <element name="INITIAL_JINGLE" />
- <element name="LISTEN_JINGLE" />
- <element name="POSITIVE_JINGLE" />
- <element name="NEGATIVE_JINGLE" />
- </enum>
-
- <enum name="SamplingRate">
- <description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="SamplingRate_8KHZ"/>
- <element name="16KHZ" internal_name="SamplingRate_16KHZ"/>
- <element name="22KHZ" internal_name="SamplingRate_22KHZ"/>
- <element name="44KHZ" internal_name="SamplingRate_44KHZ"/>
- </enum>
-
- <enum name="BitsPerSample">
- <description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="BitsPerSample_8_BIT"/>
- <element name="16_BIT" internal_name="BitsPerSample_16_BIT"/>
- </enum>
-
- <enum name="AudioType">
- <description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM" />
- </enum>
-
- <struct name="HMICapabilities">
- <param name="navigation" type="Boolean" mandatory="false">
- <description>Availability of build in Nav. True: Available, False: Not Available</description>
- </param>
- <param name="phoneCall" type="Boolean" mandatory="false">
- <description>Availability of build in phone. True: Available, False: Not Available</description>
- </param>
- </struct>
-
- <struct name="AudioPassThruCapabilities">
- <description>Describes different audio type configurations for PerformAudioPassThru.</description>
- <description>e.g. {8kHz,8-bit,PCM}</description>
- <param name="samplingRate" type="SamplingRate"/>
- <param name="bitsPerSample" type="BitsPerSample"/>
- <param name="audioType" type="AudioType"/>
- </struct>
-
- <enum name="VehicleDataType">
- <description>Defines the data types that can be published and subscribed to.</description>
- <element name="VEHICLEDATA_GPS">
- <description>Notifies GPSData may be subscribed</description>
- </element>
- <element name="VEHICLEDATA_SPEED" />
- <element name="VEHICLEDATA_RPM" />
- <element name="VEHICLEDATA_FUELLEVEL" />
- <element name="VEHICLEDATA_FUELLEVEL_STATE" />
- <element name="VEHICLEDATA_FUELCONSUMPTION" />
- <element name="VEHICLEDATA_EXTERNTEMP" />
- <element name="VEHICLEDATA_VIN" />
- <element name="VEHICLEDATA_PRNDL" />
- <element name="VEHICLEDATA_TIREPRESSURE" />
- <element name="VEHICLEDATA_ODOMETER" />
- <element name="VEHICLEDATA_BELTSTATUS" />
- <element name="VEHICLEDATA_BODYINFO" />
- <element name="VEHICLEDATA_DEVICESTATUS" />
- <element name="VEHICLEDATA_ECALLINFO" />
- <element name="VEHICLEDATA_AIRBAGSTATUS" />
- <element name="VEHICLEDATA_EMERGENCYEVENT" />
- <element name="VEHICLEDATA_CLUSTERMODESTATUS" />
- <element name="VEHICLEDATA_MYKEY" />
- <element name="VEHICLEDATA_BRAKING" />
- <element name="VEHICLEDATA_WIPERSTATUS" />
- <element name="VEHICLEDATA_HEADLAMPSTATUS" />
- <element name="VEHICLEDATA_BATTVOLTAGE" />
- <element name="VEHICLEDATA_ENGINETORQUE" />
- <element name="VEHICLEDATA_ACCPEDAL" />
- <element name="VEHICLEDATA_STEERINGWHEEL" />
- </enum>
-
- <enum name="ButtonName">
- <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
- <element name="OK" />
- <element name="SEEKLEFT" />
- <element name="SEEKRIGHT" />
- <element name="TUNEUP" />
- <element name="TUNEDOWN" />
- <element name="PRESET_0" />
- <element name="PRESET_1" />
- <element name="PRESET_2" />
- <element name="PRESET_3" />
- <element name="PRESET_4" />
- <element name="PRESET_5" />
- <element name="PRESET_6" />
- <element name="PRESET_7" />
- <element name="PRESET_8" />
- <element name="PRESET_9" />
- <element name="CUSTOM_BUTTON" />
- <element name="SEARCH" />
- </enum>
-
- <enum name="MediaClockFormat">
- <element name="CLOCK1">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
- used for Type II and CID headunits
- </description>
- </element>
- <element name="CLOCK2">
- <description>
- minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
- used for Type V headunit
- </description>
- </element>
- <element name="CLOCK3">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
- used for GEN1.1 MFD3/4/5 headunits
- </description>
- </element>
- <element name="CLOCKTEXT1">
- <description>
- 5 characters possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see TypeII column in XLS. See [@TODO: create file ref]]
- :|sp : colon or space
- used for Type II headunit
- </description>
- </element>
- <element name="CLOCKTEXT2">
- <description>
- 5 chars possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see CID column in XLS. See [@TODO: create file ref]]
- :|sp : colon or space
- used for CID headunit
- NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set
- </description>
- </element>
- <element name="CLOCKTEXT3">
- <description>
- 6 chars possible
- Format: 1|sp c c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see Type 5 column in XLS]. See [@TODO: create file ref]
- :|sp : colon or space
- used for Type V headunit
- </description>
- </element>
- <element name="CLOCKTEXT4">
- <description>
- 6 chars possible
- Format: c :|sp c c : c c
- :|sp : colon or space
- c : character out of following character set: sp|0-9|[letters].
- used for GEN1.1 MFD3/4/5 headunits
- </description>
- </element>
- </enum>
-
- <enum name="DisplayType">
- <description>See DAES for further infos regarding the displays</description>
- <element name="CID"/>
- <element name="TYPE2" />
- <element name="TYPE5" />
- <element name="NGN" />
- <element name="GEN2_8_DMA" />
- <element name="GEN2_6_DMA" />
- <element name="MFD3" />
- <element name="MFD4" />
- <element name="MFD5" />
- <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" />
- </enum>
-
- <enum name="TextFieldName">
- <element name="mainField1">
- <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField2">
- <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField3">
- <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField4">
- <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="statusBar">
- <description>The status bar on NGN; applies to "Show"</description>
- </element>
-
- <element name="mediaClock">
- <description>Text value for MediaClock field; applies to "Show"</description>
- </element>
-
- <element name="mediaTrack">
- <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
- </element>
-
- <element name="alertText1">
- <description>The first line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="alertText2">
- <description>The second line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="alertText3">
- <description>The third line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="scrollableMessageBody">
- <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
- </element>
-
- <element name="initialInteractionText">
- <description> First line suggestion for a user response (in the case of VR enabled interaction)</description>
- </element>
-
- <element name="navigationText1">
- <description> First line of navigation text</description>
- </element>
-
- <element name="navigationText2">
- <description> Second line of navigation text</description>
- </element>
-
- <element name="ETA">
- <description> Estimated Time of Arrival time for navigation</description>
- </element>
-
- <element name="totalDistance">
- <description> Total distance to destination for navigation</description>
- </element>
-
- <element name="audioPassThruDisplayText1">
- <description> First line of text for audio pass thru</description>
- </element>
-
- <element name="audioPassThruDisplayText2">
- <description> Second line of text for audio pass thru</description>
- </element>
-
- <element name="sliderHeader">
- <description> Header text for slider</description>
- </element>
-
- <element name="sliderFooter">
- <description> Footer text for slider</description>
- </element>
-
- <element name="menuName">
- <description> Primary text for Choice</description>
- </element>
-
- <element name="secondaryText">
- <description> Secondary text for Choice</description>
- </element>
-
- <element name="tertiaryText">
- <description> Tertiary text for Choice</description>
- </element>
-
- <element name="menuTitle">
- <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </element>
-
- <element name="timeToDestination">
- <description> Time to destination</description>
- </element>
-
- <element name="navigationText">
- <description>Navigation text for UpdateTurnList.</description>
- </element>
-
- <element name="notificationText">
- <description> Footer text for slider</description>
- </element>
-
- <element name="locationName">
- <description> Optional name / title of intended location for SendLocation.</description>
- </element>
-
- <element name="locationDescription">
- <description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
-
- <element name="addressLines">
- <description> Optional location address (if applicable) for SendLocation.</description>
- </element>
-
- <element name="phoneNumber">
- <description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
-
- <element name="turnText">
- <description> Turn text</description>
- </element>
-
- </enum>
-
- <enum name="ImageFieldName">
- <element name="softButtonImage">
- <description>The image field for SoftButton</description>
- </element>
-
- <element name="choiceImage">
- <description>The first image field for Choice</description>
- </element>
-
- <element name="choiceSecondaryImage">
- <description>The secondary image field for Choice</description>
- </element>
-
- <element name="vrHelpItem">
- <description>The image field for vrHelpItem</description>
- </element>
-
- <element name="turnIcon">
- <description>The image field for Turn</description>
- </element>
-
- <element name="menuIcon">
- <description>The image field for the menu icon in SetGlobalProperties</description>
- </element>
-
- <element name="cmdIcon">
- <description>The image field for AddCommand</description>
- </element>
-
- <element name="appIcon">
- <description>The image field for the app icon (set by setAppIcon)</description>
- </element>
-
- <element name="graphic">
- <description>The image field for Show</description>
- </element>
-
- <element name="showConstantTBTIcon">
- <description>The primary image field for ShowConstantTBT</description>
- </element>
-
- <element name="showConstantTBTNextTurnIcon">
- <description>The secondary image field for ShowConstantTBT</description>
- </element>
-
- <element name="locationImage">
- <description>The optional image of a destination / location</description>
- </element>
- </enum>
-
- <enum name="PredefinedLayout" platform="documentation">
- <description>Predefined screen layout.</description>
-
- <element name="DEFAULT" rootscreen="true">
- <description>
- Default media / non-media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="MEDIA" rootscreen="true">
- <description>
- Default Media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NON-MEDIA" internal_name="NON_MEDIA" rootscreen="true">
- <description>
- Default Non-media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="ONSCREEN_PRESETS" rootscreen="true">
- <description>
- Custom root media screen containing app-defined onscreen presets.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_FULLSCREEN_MAP" rootscreen="true">
- <description>
- Custom root template screen containing full screen map with navigation controls.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_LIST" rootscreen="true">
- <description>
- Custom root template screen containing video represented list.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_KEYBOARD" rootscreen="true">
- <description>
- Custom root template screen containing video represented keyboard.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXT" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with lines of text.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXT_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing lines of text with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TILES_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only tiled SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXTBUTTONS_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only text SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TILES" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with tiled SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TILES_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing tiled SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with text and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing text and SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with text only SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXTBUTTONS_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing text only SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="LARGE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing a large graphic and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="DOUBLE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing two graphics and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="LARGE_GRAPHIC_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only a large graphic.
- Can be set as a root screen.
- </description>
- </element>
- </enum>
-
- <enum name="CharacterSet">
- <description>The list of potential character sets</description>
- <element name="TYPE2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="TYPE5SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID1SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- </enum>
-
- <enum name="TextAlignment">
- <description>The list of possible alignments, left, right, or centered</description>
- <element name="LEFT_ALIGNED" />
- <element name="RIGHT_ALIGNED" />
- <element name="CENTERED" />
- </enum>
-
- <enum name="TBTState">
- <description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
- <element name="ROUTE_UPDATE_REQUEST" />
- <element name="ROUTE_ACCEPTED" />
- <element name="ROUTE_REFUSED" />
- <element name="ROUTE_CANCELLED" />
- <element name="ETA_REQUEST" />
- <element name="NEXT_TURN_REQUEST" />
- <element name="ROUTE_STATUS_REQUEST" />
- <element name="ROUTE_SUMMARY_REQUEST" />
- <element name="TRIP_STATUS_REQUEST" />
- <element name="ROUTE_UPDATE_REQUEST_TIMEOUT" />
- </enum>
-
- <enum name="DriverDistractionState">
- <description>Enumeration that describes possible states of driver distraction.</description>
- <element name="DD_ON" />
- <element name="DD_OFF" />
- </enum>
-
- <enum name="ImageType">
- <description>Contains information about the type of image.</description>
- <element name="STATIC" />
- <element name="DYNAMIC" />
- </enum>
-
- <struct name="Image">
- <param name="value" minlength="0" maxlength="65535" type="String">
- <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
- </param>
- <param name="imageType" type="ImageType">
- <description>Describes, whether it is a static or dynamic image.</description>
- </param>
- </struct>
-
- <struct name="SoftButton">
- <param name="type" type="SoftButtonType">
- <description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
- </param>
- <param name="text" minlength="0" maxlength="500" type="String" mandatory="false">
- <description>Optional text to display (if defined as TEXT or BOTH)</description>
- </param>
- <param name="image" type="Image" mandatory="false">
- <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
- </param>
- <param name="isHighlighted" type="Boolean" defvalue="false" mandatory="false">
- <description>
- True, if highlighted
- False, if not highlighted
- </description>
- </param>
- <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535">
- <description>Value which is returned via OnButtonPress / OnButtonEvent</description>
- </param>
- <param name="systemAction" type="SystemAction" defvalue="DEFAULT_ACTION" mandatory="false">
- <description>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</description>
- </param>
- </struct>
-
- <struct name="Choice">
- <description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="menuName" type="String" maxlength="500" />
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" />
- <param name="image" type="Image" mandatory="false"/>
- <param name="secondaryText" maxlength="500" type="String" mandatory="false">
- <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
- </param>
- <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
- <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
- </param>
- <param name="secondaryImage" type="Image" mandatory="false">
- <description>Optional secondary image struct for choice</description>
- </param>
- </struct>
-
- <struct name="VrHelpItem">
- <param name="text" maxlength="500" type="String">
- <description>Text to display for VR Help item</description>
- </param>
- <param name="image" type="Image" mandatory="false">
- <description>Image struct for VR Help item</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="100">
- <description>Position to display item in VR Help list</description>
- </param>
- </struct>
-
- <struct name="SyncMsgVersion">
- <description>Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application</description>
-
- <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10">
- <description>The major version indicates versions that is not-compatible to previous versions.</description>
- </param>
- <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000">
- <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
- </param>
- </struct>
-
- <enum name="GlobalProperty">
- <description>The different global properties.</description>
- <element name="HELPPROMPT">
- <description>The property helpPrompt of setGlobalProperties</description>
- </element>
- <element name="TIMEOUTPROMPT">
- <description>The property timeoutPrompt of setGlobalProperties</description>
- </element>
- <element name="VRHELPTITLE">
- <description>The property vrHelpTitle of setGlobalProperties</description>
- </element>
- <element name="VRHELPITEMS">
- <description>The property array of vrHelp of setGlobalProperties</description>
- </element>
- <element name="MENUNAME">
- <description>The property in-app menu name of setGlobalProperties</description>
- </element>
- <element name="MENUICON">
- <description>The property in-app menu icon of setGlobalProperties</description>
- </element>
- <element name="KEYBOARDPROPERTIES">
- <description>The on-screen keyboard configuration of setGlobalProperties</description>
- </element>
- </enum>
-
- <enum name="CompassDirection">
- <description>The list of potential compass directions</description>
- <element name="NORTH">
- </element>
- <element name="NORTHWEST">
- </element>
- <element name="WEST">
- </element>
- <element name="SOUTHWEST">
- </element>
- <element name="SOUTH">
- </element>
- <element name="SOUTHEAST">
- </element>
- <element name="EAST">
- </element>
- <element name="NORTHEAST">
- </element>
- </enum>
-
- <enum name="Dimension">
- <description>The supported dimensions of the GPS</description>
- <element name="NO_FIX" internal_name="Dimension_NO_FIX">
- <description>No GPS at all</description>
- </element>
- <element name="2D" internal_name="Dimension_2D">
- <description>Longitude and lattitude</description>
- </element>
- <element name="3D" internal_name="Dimension_3D">
- <description>Longitude and lattitude and altitude</description>
- </element>
- </enum>
-
- <enum name="PRNDL">
- <description>The selected gear.</description>
- <element name="PARK">
- <description>Parking</description>
- </element>
- <element name="REVERSE">
- <description>Reverse gear</description>
- </element>
- <element name="NEUTRAL">
- <description>No gear</description>
- </element>
- <element name="DRIVE">
- </element>
- <element name="SPORT">
- <description>Drive Sport mode</description>
- </element>
- <element name="LOWGEAR">
- <description>1st gear hold</description>
- </element>
- <element name="FIRST">
- </element>
- <element name="SECOND">
- </element>
- <element name="THIRD">
- </element>
- <element name="FOURTH">
- </element>
- <element name="FIFTH">
- </element>
- <element name="SIXTH">
- </element>
- <element name="SEVENTH">
- </element>
- <element name="EIGHTH">
- </element>
- <element name="UNKNOWN">
- </element>
- <element name="FAULT">
- </element>
- </enum>
-
- <enum name="ComponentVolumeStatus">
- <description>The volume status of a vehicle component.</description>
- <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
- </element>
- <element name="NORMAL" internal_name="CVS_NORMAL">
- </element>
- <element name="LOW" internal_name="CVS_LOW">
- </element>
- <element name="FAULT" internal_name="CVS_FAULT">
- </element>
- <element name="ALERT" internal_name="CVS_ALERT">
- </element>
- <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
- </element>
- </enum>
-
- <struct name="SingleTireStatus">
- <param name="status" type="ComponentVolumeStatus">
- <description>See ComponentVolumeStatus.</description>
- </param>
- </struct>
-
- <enum name="WarningLightStatus">
- <description>Reflects the status of a cluster instrument warning light.</description>
- <element name="OFF" internal_name="WLS_OFF">
- </element>
- <element name="ON" internal_name="WLS_ON">
- </element>
- <element name="FLASH" internal_name="WLS_FLASH">
- </element>
- <element name="NOT_USED" internal_name="WLS_NOT_USED">
- </element>
- </enum>
-
- <enum name="VehicleDataNotificationStatus">
- <description>Reflects the status of a vehicle data notification.</description>
- <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
- </element>
- <element name="NORMAL" internal_name="VDNS_NORMAL">
- </element>
- <element name="ACTIVE" internal_name="VDNS_ACTIVE">
- </element>
- <element name="NOT_USED" internal_name="VDNS_NOT_USED">
- </element>
- </enum>
-
- <enum name="IgnitionStableStatus">
- <description>Reflects the ignition switch stability.</description>
- <element name="IGNITION_SWITCH_NOT_STABLE">
- </element>
- <element name="IGNITION_SWITCH_STABLE">
- </element>
- <element name="MISSING_FROM_TRANSMITTER">
- </element>
- </enum>
-
- <enum name="IgnitionStatus">
- <description>Reflects the status of ignition.</description>
- <element name="UNKNOWN" internal_name="IS_UNKNOWN">
- </element>
- <element name="OFF" internal_name="IS_OFF">
- </element>
- <element name="ACCESSORY" internal_name="IS_ACCESSORY">
- </element>
- <element name="RUN" internal_name="IS_RUN">
- </element>
- <element name="START" internal_name="IS_START">
- </element>
- <element name="INVALID" internal_name="IS_INVALID">
- </element>
- </enum>
-
- <enum name="VehicleDataEventStatus">
- <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
- <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
- </element>
- <element name="NO" internal_name="VDES_NO">
- </element>
- <element name="YES" internal_name="VDES_YES">
- </element>
- <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="VDES_FAULT">
- </element>
- </enum>
-
- <enum name="DeviceLevelStatus">
- <description>Reflects the reported battery status of the connected device, if reported.</description>
- <element name="ZERO_LEVEL_BARS">
- </element>
- <element name="ONE_LEVEL_BARS">
- </element>
- <element name="TWO_LEVEL_BARS">
- </element>
- <element name="THREE_LEVEL_BARS">
- </element>
- <element name="FOUR_LEVEL_BARS">
- </element>
- <element name="NOT_PROVIDED">
- </element>
- </enum>
-
- <enum name="PrimaryAudioSource">
- <description>Reflects the current primary audio source (if selected).</description>
- <element name="NO_SOURCE_SELECTED">
- </element>
- <element name="USB">
- </element>
- <element name="USB2">
- </element>
- <element name="BLUETOOTH_STEREO_BTST">
- </element>
- <element name="LINE_IN">
- </element>
- <element name="IPOD">
- </element>
- <element name="MOBILE_APP">
- </element>
- </enum>
-
- <enum name="WiperStatus">
- <description>Reflects the status of the wipers.</description>
- <element name="OFF" />
- <element name="AUTO_OFF" />
- <element name="OFF_MOVING" />
- <element name="MAN_INT_OFF" />
- <element name="MAN_INT_ON" />
- <element name="MAN_LOW" />
- <element name="MAN_HIGH" />
- <element name="MAN_FLICK" />
- <element name="WASH" />
- <element name="AUTO_LOW" />
- <element name="AUTO_HIGH" />
- <element name="COURTESYWIPE" />
- <element name="AUTO_ADJUST" />
- <element name="STALLED" />
- <element name="NO_DATA_EXISTS" />
- </enum>
-
- <enum name="VehicleDataStatus">
- <description>Reflects the status of a binary vehicle data item.</description>
- <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
- </element>
- <element name="OFF" internal_name="VDS_OFF">
- </element>
- <element name="ON" internal_name="VDS_ON">
- </element>
- </enum>
-
- <enum name="MaintenanceModeStatus">
- <description>Reflects the status of a vehicle maintenance mode.</description>
- <element name="NORMAL" internal_name="MMS_NORMAL">
- </element>
- <element name="NEAR" internal_name="MMS_NEAR">
- </element>
- <element name="ACTIVE" internal_name="MMS_ACTIVE">
- </element>
- <element name="FEATURE_NOT_PRESENT" internal_name="MMS_FEATURE_NOT_PRESENT">
- </element>
- </enum>
-
- <enum name="VehicleDataActiveStatus">
- <description>Reflects the status of given vehicle component.</description>
- <element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
- </element>
- <element name="INACTIVE_CONFIRMED" internal_name="VDAS_INACTIVE_CONFIRMED">
- </element>
- <element name="ACTIVE_NOT_CONFIRMED" internal_name="VDAS_ACTIVE_NOT_CONFIRMED">
- </element>
- <element name="ACTIVE_CONFIRMED" internal_name="VDAS_ACTIVE_CONFIRMED">
- </element>
- <element name="FAULT" internal_name="VDAS_FAULT">
- </element>
- </enum>
-
- <enum name="AmbientLightStatus">
- <description>Reflects the status of the ambient light sensor.</description>
- <element name="NIGHT" />
- <element name="TWILIGHT_1" />
- <element name="TWILIGHT_2" />
- <element name="TWILIGHT_3" />
- <element name="TWILIGHT_4" />
- <element name="DAY" />
- <element name="UNKNOWN" />
- <element name="INVALID" />
- </enum>
-
- <struct name="BeltStatus">
- <param name="driverBeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverBuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerChildDetected" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRearInflatableBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRearInflatableBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="BodyInformation">
- <param name="parkBrakeActive" type="Boolean">
- <description>References signal "PrkBrkActv_B_Actl".</description>
- </param>
- <param name="ignitionStableStatus" type="IgnitionStableStatus">
- <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
- </param>
- <param name="ignitionStatus" type="IgnitionStatus">
- <description>References signal "Ignition_status". See IgnitionStatus.</description>
- </param>
- <param name="driverDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatDrv_B_Actl".</description>
- </param>
- <param name="passengerDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatPsngr_B_Actl".</description>
- </param>
- <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRl_B_Actl".</description>
- </param>
- <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRr_B_Actl".</description>
- </param>
- </struct>
-
- <struct name="DeviceStatus">
- <param name="voiceRecOn" type="Boolean">
- <description>References signal "CPM_VoiceRec_STAT".</description>
- </param>
- <param name="btIconOn" type="Boolean">
- <description>References signal "BT_ICON".</description>
- </param>
- <param name="callActive" type="Boolean">
- <description>References signal "CPM_Call_Active_STAT".</description>
- </param>
- <param name="phoneRoaming" type="Boolean">
- <description>References signal "CPM_Phone_Roaming_STAT".</description>
- </param>
- <param name="textMsgAvailable" type="Boolean">
- <description>References signal "CPM_TextMsg_AVAL".</description>
- </param>
- <param name="battLevelStatus" type="DeviceLevelStatus">
- <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
- </param>
- <param name="stereoAudioOutputMuted" type="Boolean">
- <description>References signal "CPM_Stereo_Audio_Output".</description>
- </param>
- <param name="monoAudioOutputMuted" type="Boolean">
- <description>References signal "CPM_Mono_Audio_Output".</description>
- </param>
- <param name="signalLevelStatus" type="DeviceLevelStatus">
- <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
- </param>
- <param name="primaryAudioSource" type="PrimaryAudioSource">
- <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
- </param>
- <param name="eCallEventActive" type="Boolean">
- <description>References signal "eCall_Event".</description>
- </param>
- </struct>
-
- <struct name="HeadLampStatus">
- <param name="lowBeamsOn" type="Boolean">
- <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
- </param>
- <param name="highBeamsOn" type="Boolean">
- <description>Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat".</description>
- </param>
- <param name="ambientLightSensorStatus" type="AmbientLightStatus">
- <description>Status of the ambient light sensor.</description>
- </param>
- </struct>
-
- <struct name="engineInfo">
- <param name="electricFuelConsumption" type="Float" minvalue="0" maxvalue="30000">
- <description>
- Indicates the electric fuel consumption in terms of gasoline equivalent volume to support fuel economy equivalent calculations.
- Note:Plug-in vehicle use only!
- References signal "ElFuelFlw_Vl_Dsply".
- </description>
- </param>
- <param name="stateOfCharge" type="Float" minvalue="0" maxvalue="100">
- <description>Percent state of charge for the high voltage battery. References signal "BattTracSoc_Pc_Dsply".</description>
- </param>
- <param name="fuelMaintenanceMode" type="MaintenanceModeStatus">
- <description>Current status of fuel maintenance mode (if present on hybrid vehicles). References signal "FuelMaintMde_D_Dsply".</description>
- </param>
- <param name="distanceToEmpty" type="Float" minvalue="0" maxvalue="1000">
- <description>
- Electric range (DTE) in km. References signal "VehElRnge_L_Dsply".
- 0xFFE = No Data Exists
- 0xFFF = Fault
- </description>
- </param>
- </struct>
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- Ford Specific Data Items -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
- <enum name="FuelCutoffStatus">
- <description>Reflects the status of the RCM fuel cutoff.</description>
- <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
- </element>
- <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
- </element>
- <element name="FAULT" internal_name="FCS_FAULT">
- </element>
- </enum>
-
- <enum name="EmergencyEventType">
- <description>Reflects the emergency event status of the vehicle.</description>
- <element name="NO_EVENT" internal_name="EET_NO_EVENT">
- </element>
- <element name="FRONTAL" internal_name="EET_FRONTAL">
- </element>
- <element name="SIDE" internal_name="EET_SIDE">
- </element>
- <element name="REAR" internal_name="EET_REAR">
- </element>
- <element name="ROLLOVER" internal_name="EET_ROLLOVER">
- </element>
- <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="EET_FAULT">
- </element>
- </enum>
-
- <enum name="ECallConfirmationStatus">
- <description>Reflects the status of the eCall Notification.</description>
- <element name="NORMAL" internal_name="ECCS_NORMAL">
- </element>
- <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
- </element>
- <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
- </element>
- <element name="CALL_COMPLETED">
- </element>
- <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
- </element>
- <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
- </element>
- <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
- </element>
- </enum>
-
- <struct name="DeviceInfo">
- <description>Various information abount connecting device.</description>
-
- <param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device model</description>
- </param>
- <param name="firmwareRev" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device firmware revision</description>
- </param>
- <param name="os" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device OS</description>
- </param>
- <param name="osVersion" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device OS version</description>
- </param>
- <param name="carrier" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device mobile carrier (if applicable)</description>
- </param>
- <param name="maxNumberRFCOMMPorts" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- <description>Omitted if connected not via BT.</description>
- </param>
-
- </struct>
-
- <enum name="FileType">
- <description>Enumeration listing possible file types.</description>
- <element name="GRAPHIC_BMP" />
- <element name="GRAPHIC_JPEG" />
- <element name="GRAPHIC_PNG" />
- <element name="AUDIO_WAVE" />
- <element name="AUDIO_MP3" />
- <element name="AUDIO_AAC" />
- <element name="BINARY" />
- <element name="JSON" />
- </enum>
-
- <enum name="PowerModeQualificationStatus">
- <description>Reflects the status of the current power mode qualification.</description>
- <element name="POWER_MODE_UNDEFINED">
- </element>
- <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
- </element>
- <element name="NOT_DEFINED">
- </element>
- <element name="POWER_MODE_OK">
- </element>
- </enum>
-
- <enum name="PowerModeStatus">
- <description>Reflects the status of the current power mode.</description>
- <element name="KEY_OUT">
- </element>
- <element name="KEY_RECENTLY_OUT">
- </element>
- <element name="KEY_APPROVED_0">
- </element>
- <element name="POST_ACCESORY_0">
- </element>
- <element name="ACCESORY_1">
- </element>
- <element name="POST_IGNITION_1">
- </element>
- <element name="IGNITION_ON_2">
- </element>
- <element name="RUNNING_2">
- </element>
- <element name="CRANK_3">
- </element>
- </enum>
-
- <enum name="CarModeStatus">
- <description>Reflects the status of the current car mode.</description>
- <element name="NORMAL" internal_name="CMS_NORMAL">
- </element>
- <element name="FACTORY" internal_name="CMS_FACTORY">
- </element>
- <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
- </element>
- <element name="CRASH" internal_name="CMS_CRASH">
- </element>
- </enum>
-
- <struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="VehicleDataNotificationStatus">
- <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus">
- <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="eCallConfirmationStatus" type="ECallConfirmationStatus">
- <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
- </param>
- </struct>
-
- <struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="EmergencyEvent">
- <param name="emergencyEventType" type="EmergencyEventType">
- <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
- </param>
- <param name="fuelCutoffStatus" type="FuelCutoffStatus">
- <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
- </param>
- <param name="rolloverEvent" type="VehicleDataEventStatus">
- <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
-
- <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255">
- <description>References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values:
- 0x00 No event
- 0xFE Not supported
- 0xFF Fault
- </description>
- </param>
- <param name="multipleEvents" type="VehicleDataEventStatus">
- <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="ClusterModeStatus">
- <param name="powerModeActive" type="Boolean">
- <description>References signal "PowerMode_UB".</description>
- </param>
- <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus">
- <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
- </param>
- <param name="carModeStatus" type="CarModeStatus">
- <description>References signal "CarMode". See CarMode.</description>
- </param>
- <param name="powerModeStatus" type="PowerModeStatus">
- <description>References signal "PowerMode". See PowerMode.</description>
- </param>
- </struct>
-
- <struct name="MyKey">
- <param name="e911Override" type="VehicleDataStatus">
- <description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
- </param>
- </struct>
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- / Ford Specific Data Items -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
- <enum name="VehicleDataResultCode">
- <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
- <element name="SUCCESS" internal_name="VDRC_SUCCESS"/>
- <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA"/>
- <element name="DISALLOWED" internal_name="VDRC_DISALLOWED"/>
- <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED"/>
- <element name="INVALID_ID" internal_name="VDRC_INVALID_ID"/>
- <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE"/>
- <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED"/>
- <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED"/>
- <element name="IGNORED" internal_name="VDRC_IGNORED"/>
- </enum>
-
- <struct name="TireStatus">
- <description>The status and pressure of the tires.</description>
-
- <param name="pressureTelltale" type="WarningLightStatus">
- <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
- </param>
- <param name="leftFront" type="SingleTireStatus">
- <description>The status of the left front tire.</description>
- </param>
- <param name="rightFront" type="SingleTireStatus">
- <description>The status of the right front tire.</description>
- </param>
- <param name="leftRear" type="SingleTireStatus">
- <description>The status of the left rear tire.</description>
- </param>
- <param name="rightRear" type="SingleTireStatus">
- <description>The status of the right rear tire.</description>
- </param>
- <param name="innerLeftRear" type="SingleTireStatus">
- <description>The status of the inner left rear.</description>
- </param>
- <param name="innerRightRear" type="SingleTireStatus">
- <description>The status of the inner right rear.</description>
- </param>
- </struct>
-
- <struct name="GPSData">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100">
- <description>The current UTC year.</description>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12">
- <description>The current UTC month.</description>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31">
- <description>The current UTC day.</description>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23">
- <description>The current UTC hour.</description>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59">
- <description>The current UTC minute.</description>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59">
- <description>The current UTC second.</description>
- </param>
- <param name="compassDirection" type="CompassDirection">
- <description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>HDOP. If value is unknown, value shall be set to 0.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>VDOP. If value is unknown, value shall be set to 0.</description>
- </param>
- <param name="actual" type="Boolean">
- <description>
- True, if actual.
- False, if infered.
- </description>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31">
- <description>Number of satellites in view</description>
- </param>
- <param name="dimension" type="Dimension">
- <description>See Dimension</description>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000">
- <description>Altitude in meters</description>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99">
- <description>The heading. North is 0. Resolution is 0.01</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500">
- <description>The speed in KPH</description>
- </param>
- </struct>
-
- <struct name="VehicleDataResult">
- <description>Individual published data request result</description>
- <param name="dataType" type="VehicleDataType">
- <description>Defined published data element type.</description>
- </param>
- <param name="resultCode" type="VehicleDataResultCode">
- <description>Published data result code.</description>
- </param>
- </struct>
-
- <struct name="DIDResult">
- <description>Individual requested DID result and data</description>
- <param name="resultCode" type="VehicleDataResultCode">
- <description>Individual DID result code.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Location of raw data from vehicle data DID</description>
- </param>
- <param name="data" type="String" maxlength="5000" mandatory="false">
- <description>Raw DID-based data returned for requested element.</description>
- </param>
- </struct>
-
- <struct name="StartTime">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59">
- <description>
- The hour of the media clock.
- Some radios only support a max of 19 hours. If out of range, it will be rejected.
- </description>
- </param>
- <param name="minutes" type="Integer" minvalue="0" maxvalue="59" />
- <param name="seconds" type="Integer" minvalue="0" maxvalue="59" />
- </struct>
-
- <struct name="TextField">
- <param name="name" type="TextFieldName">
- <description>The name that identifies the field. See TextFieldName.</description>
- </param>
- <param name="characterSet" type="CharacterSet">
- <description>The character set that is supported in this field. See CharacterSet.</description>
- </param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500">
- <description>The number of characters in one row of this field.</description>
- </param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8">
- <description>The number of rows of this field.</description>
- </param>
- </struct>
-
- <struct name="ImageResolution">
- <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000">
- <description>The image resolution width.</description>
- </param>
- <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000">
- <description>The image resolution height.</description>
- </param>
- </struct>
-
- <struct name="ImageField">
- <param name="name" type="ImageFieldName">
- <description>The name that identifies the field. See ImageFieldName.</description>
- </param>
- <param name="imageTypeSupported" type="FileType" array="true">
- <description>The image types that are supported in this field. See FileType.</description>
- </param>
- <param name="imageResolution" type="ImageResolution">
- <description>The image resolution of this field.</description>
- </param>
- </struct>
-
- <struct name="TouchCoord">
- <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The x coordinate of the touch.</description>
- </param>
- <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The y coordinate of the touch.</description>
- </param>
- </struct>
-
- <enum name="TouchType">
- <element name="BEGIN"/>
- <element name="MOVE"/>
- <element name="END"/>
- </enum>
-
- <struct name="TouchEvent">
- <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
- <description>
- A touch's unique identifier. The application can track the current touch events by id.
- If a touch event has type begin, the id should be added to the set of touches.
- If a touch event has type end, the id should be removed from the set of touches.
- </description>
- </param>
- <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2147483647" minsize="1" maxsize="1000">
- <description>
- The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
- The timestamp is used to determined the rate of change of position of a touch.
- The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
- If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
- </description>
- </param>
- <param name="c" type="TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
- </param>
- </struct>
-
- <struct name="Coordinate">
- <param name="xCoord" type="Integer" mandatory="true">
- </param>
- <param name="yCoord" type="Integer" mandatory="true">
- </param>
- </struct>
-
- <struct name="TouchArea">
- <param name="rotationAngle" type="Float" mandatory="false" minvalue="0" maxvalue="360">
- </param>
- <param name="radiusCoord" type="Coordinate" mandatory="true">
- </param>
- </struct>
-
- <struct name="TouchEventCapabilities">
- <param name="pressAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="multiTouchAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="doublePressAvailable" type="Boolean" mandatory="true">
- </param>
- </struct>
-
- <struct name="ScreenParams">
- <param name="resolution" type="ImageResolution" mandatory="true">
- <description>The resolution of the prescribed screen area.</description>
- </param>
- <param name="touchEventAvailable" type="TouchEventCapabilities" mandatory="false">
- <description>Types of screen touch events available in screen area.</description>
- </param>
- </struct>
-
- <enum name="PermissionStatus">
- <description>Enumeration that describes possible permission states of a policy table entry.</description>
- <element name="ALLOWED" internal_name="PS_ALLOWED"/>
- <element name="DISALLOWED" internal_name="PS_DISALLOWED"/>
- <element name="USER_DISALLOWED" internal_name="PS_USER_DISALLOWED"/>
- <element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
- </enum>
-
- <struct name="HMIPermissions">
- <param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true">
- <description>A set of all HMI levels that are permitted for this given RPC.</description>
- </param>
- <param name="userDisallowed" type="HMILevel" minsize="0" maxsize="100" array="true">
- <description>A set of all HMI levels that are prohibited for this given RPC.</description>
- </param>
- </struct>
-
- <struct name="ParameterPermissions">
- <param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
- <description>A set of all parameters that are permitted for this given RPC.</description>
- </param>
- <param name="userDisallowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
- <description>A set of all parameters that are prohibited for this given RPC.</description>
- </param>
- </struct>
-
- <struct name="PermissionItem">
- <param name="rpcName" type="String" maxlength="100">
- <description>Name of the individual RPC in the policy table.</description>
- </param>
- <param name="hmiPermissions" type="HMIPermissions" />
- <param name="parameterPermissions" type="ParameterPermissions" />
- </struct>
-
- <struct name="DisplayCapabilities">
- <description>Contains information about the display capabilities.</description>
- <param name="displayType" type="DisplayType">
- <description>The type of the display. See DisplayType</description>
- </param>
- <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true">
- <description>A set of all fields that support text data. See TextField</description>
- </param>
- <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true">
- <description>A set of all fields that support images. See ImageField</description>
- </param>
- <param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true">
- <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
- </param>
- <param name="graphicSupported" type="Boolean">
- <description>The display's persistent screen supports referencing a static or dynamic image.</description>
- </param>
- <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true">
- <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
- </param>
- <param name="screenParams" type="ScreenParams" mandatory="false">
- <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
- </param>
- <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
- <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
- </param>
- </struct>
-
- <struct name="ButtonCapabilities">
- <description>Contains information about a button's capabilities.</description>
- <param name="name" type="ButtonName">
- <description>The name of the button. See ButtonName.</description>
- </param>
- <param name="shortPressAvailable" type="Boolean">
- <description>
- The button supports a short press.
- Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- </description>
- </param>
- <param name="longPressAvailable" type="Boolean">
- <description>
- The button supports a LONG press.
- Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- </description>
- </param>
- <param name="upDownAvailable" type="Boolean">
- <description>
- The button supports "button down" and "button up".
- Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- Whenever the button is released, onButtonEvent( UP) will be invoked.
- </description>
- </param>
- </struct>
-
- <struct name="SoftButtonCapabilities">
- <description>Contains information about a SoftButton's capabilities.</description>
- <param name="shortPressAvailable" type="Boolean">
- <description>
- The button supports a short press.
- Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- </description>
- </param>
- <param name="longPressAvailable" type="Boolean">
- <description>
- The button supports a LONG press.
- Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- </description>
- </param>
- <param name="upDownAvailable" type="Boolean">
- <description>
- The button supports "button down" and "button up".
- Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- Whenever the button is released, onButtonEvent( UP) will be invoked.
- </description>
- </param>
- <param name="imageSupported" type="Boolean">
- <description>The button supports referencing a static or dynamic image.</description>
- </param>
- </struct>
-
- <struct name="PresetBankCapabilities">
- <description>Contains information about on-screen preset capabilities.</description>
- <param name="onScreenPresetsAvailable" type="Boolean">
- <description>Onscreen custom presets are available.</description>
- </param>
- </struct>
-
- <struct name="MenuParams">
- <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" defvalue="0" mandatory="false">
- <description>
- unique ID of the sub menu, the command will be added to.
- If not provided, it will be provided to the top level of the in application menu.
- </description>
- </param>
-
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
- <description>
- Position within the items that are are at top level of the in application menu.
- 0 will insert at the front.
- 1 will insert at the second position.
- if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
- If this param was omitted the entry will be added at the end.
- </description>
- </param>
-
- <param name="menuName" type="String" maxlength="500">
- <description>Text to show in the menu for this sub menu.</description>
- </param>
- </struct>
-
- <struct name="TTSChunk">
- <description>A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI)</description>
- <param name="text" minlength="0" maxlength="500" type="String">
- <description>
- The text or phonemes to speak.
- May not be empty.
- </description>
- </param>
- <param name="type" type="SpeechCapabilities">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
- </param>
- </struct>
-
- <struct name="Turn">
- <param name="navigationText" type="String" maxlength="500" mandatory="false">
- </param>
- <param name="turnIcon" type="Image" mandatory="false">
- </param>
- </struct>
-
- <struct name="VehicleType">
- <param name="make" type="String" maxlength="500" mandatory="false">
- <description>Make of the vehicle, e.g. Ford</description>
- </param>
- <param name="model" type="String" maxlength="500" mandatory="false">
- <description>Model of the vehicle, e.g. Fiesta</description>
- </param>
- <param name="modelYear" type="String" maxlength="500" mandatory="false">
- <description>Model Year of the vehicle, e.g. 2013</description>
- </param>
- <param name="trim" type="String" maxlength="500" mandatory="false">
- <description>Trim of the vehicle, e.g. SE</description>
- </param>
- </struct>
-
- <enum name="KeyboardLayout">
- <description>Enumeration listing possible keyboard layouts.</description>
- <element name="QWERTY" />
- <element name="QWERTZ" />
- <element name="AZERTY" />
- </enum>
-
- <enum name="KeyboardEvent" platform="MobileNav">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="KEYPRESS" />
- <element name="ENTRY_SUBMITTED" />
- <element name="ENTRY_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>
-
- <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="FunctionID" internal_scope="base">
- <description>Enumeration linking function names with function IDs in AppLink protocol.</description>
- <description>Assumes enumeration starts at value 0.</description>
- <element name="RESERVED" value="0" />
-<!--
- Base Request / Response RPCs
- Range = 0x 0000 0001 - 0x 0000 7FFF
--->
- <element name="RegisterAppInterfaceID" value="1" hexvalue="1" />
- <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" />
- <element name="SetGlobalPropertiesID" value="3" hexvalue="3" />
- <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" />
- <element name="AddCommandID" value="5" hexvalue="5" />
- <element name="DeleteCommandID" value="6" hexvalue="6" />
- <element name="AddSubMenuID" value="7" hexvalue="7" />
- <element name="DeleteSubMenuID" value="8" hexvalue="8" />
- <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" />
- <element name="PerformInteractionID" value="10" hexvalue="A" />
- <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" />
- <element name="AlertID" value="12" hexvalue="C" />
- <element name="ShowID" value="13" hexvalue="D" />
- <element name="SpeakID" value="14" hexvalue="E" />
- <element name="SetMediaClockTimerID" value="15" hexvalue="F" />
- <element name="PerformAudioPassThruID" value="16" hexvalue="10" />
- <element name="EndAudioPassThruID" value="17" hexvalue="11" />
- <element name="SubscribeButtonID" value="18" hexvalue="12" />
- <element name="UnsubscribeButtonID" value="19" hexvalue="13" />
- <element name="SubscribeVehicleDataID" value="20" hexvalue="14" />
- <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" />
- <element name="GetVehicleDataID" value="22" hexvalue="16" />
- <element name="ReadDIDID" value="23" hexvalue="17" />
- <element name="GetDTCsID" value="24" hexvalue="18" />
- <element name="ScrollableMessageID" value="25" hexvalue="19" />
- <element name="SliderID" value="26" hexvalue="1A" />
- <element name="ShowConstantTBTID" value="27" hexvalue="1B" />
- <element name="AlertManeuverID" value="28" hexvalue="1C" />
- <element name="UpdateTurnListID" value="29" hexvalue="1D" />
- <element name="ChangeRegistrationID" value="30" hexvalue="1E" />
- <element name="GenericResponseID" value="31" hexvalue="1F" />
- <element name="PutFileID" value="32" hexvalue="20" />
- <element name="DeleteFileID" value="33" hexvalue="21" />
- <element name="ListFilesID" value="34" hexvalue="22" />
- <element name="SetAppIconID" value="35" hexvalue="23" />
- <element name="SetDisplayLayoutID" value="36" hexvalue="24" />
- <element name="DiagnosticMessageID" value="37" hexvalue="25" />
- <element name="SystemRequestID" value="38" hexvalue="26" />
- <element name="SendLocationID" value="39" hexvalue="27" />
- <element name="DialNumberID" value="40" hexvalue="28" />
-
-
-
-<!--
- Base Notifications
- Range = 0x 0000 8000 - 0x 0000 FFFF
--->
-
- <element name="OnHMIStatusID" value="32768" hexvalue="8000" />
- <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" />
- <element name="OnButtonEventID" value="32770" hexvalue="8002" />
- <element name="OnButtonPressID" value="32771" hexvalue="8003" />
- <element name="OnVehicleDataID" value="32772" hexvalue="8004" />
- <element name="OnCommandID" value="32773" hexvalue="8005" />
- <element name="OnTBTClientStateID" value="32774" hexvalue="8006" />
- <element name="OnDriverDistractionID" value="32775" hexvalue="8007" />
- <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" />
- <element name="OnAudioPassThruID" value="32777" hexvalue="8009" />
- <element name="OnLanguageChangeID" value="32778" hexvalue="800A" />
- <element name="OnKeyboardInputID" value="32779" hexvalue="800B" />
- <element name="OnTouchEventID" value="32780" hexvalue="800C" />
- <element name="OnSystemRequestID" value="32781" hexvalue="800D" />
- <element name="OnHashChangeID" value="32782" hexvalue="800E" />
-<!--
- Ford Specific Request / Response RPCs
- Range = 0x 0001 0000 - 0x 0001 7FFF
--->
-
-
-<!--
- Ford Specific Notifications
- Range = 0x 0001 8000 - 0x 0001 FFFF
--->
-
- </enum>
-
- <enum name="messageType">
- <description>
- Enumeration linking message types with function types in WiPro protocol.
- Assumes enumeration starts at value 0.
- </description>
- <element name="request" value="0" />
- <element name="response" value="1" />
- <element name="notification" value="2" />
- </enum>
-
- <!-- Requests/Responses -->
-
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request">
- <description>
- Establishes an interface with a mobile application.
- Before registerAppInterface no other commands will be accepted/executed.
- </description>
-
- <param name="syncMsgVersion" type="SyncMsgVersion">
- <description>See SyncMsgVersion</description>
- </param>
-
- <param name="appName" type="String" maxlength="100">
- <description>
- The mobile application name, e.g. "Ford Drive Green".
- Needs to be unique over all applications.
- May not be empty.
- May not start with a new line character.
- May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands)
- Needs to be unique over all applications. Applications with the same name will be rejected.
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- Needs to be unique over all applications.
- May not be empty.
- May not start with a new line character.
- </description>
- </param>
-
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>
- Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.
- If not provided, the appName is used instead (and will be truncated if too long)
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Defines an additional voice recognition command.
- May not interfere with any app name of previously registered applications and any predefined blacklist of words
- (global commands)
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="isMediaApplication" type="Boolean">
- <description>
- Indicates if the application is a media or a non-media application.
- Only media applications will be able to stream audio to Sync that is audible outside of the BT media source.
- </description>
- </param>
- <param name="languageDesired" type="Language" mandatory="true">
- <description>
- See Language
- Current app’s expected VR+TTS language
- If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
- </description>
- </param>
- <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true">
- <description>
- See Language
- Current app’s expected display language
- If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
- </description>
- </param>
- <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- See AppHMIType
- List of all applicable app HMI types stating which HMI classifications to be given to the app.
- e.g. for platforms like GEN2, this will determine which "corner(s)" the app can populate.
- </description>
- </param>
- <param name="hashID" type="String" maxlength="100" mandatory="false">
- <description>
- ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).
- This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece.
- If omitted, then the previous state of an app's commands, etc. will not be restored.
- </description>
- </param>
- <param name="deviceInfo" type="DeviceInfo" mandatory="false">
- <description>
- See DeviceInfo.
- </description>
- </param>
- <param name="appID" type="String" maxlength="100" mandatory="true">
- <description>ID used to validate app with policy table entries</description>
- </param>
- </function>
-
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response">
- <description>The response to registerAppInterface</description>
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="GENERIC_ERROR"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TOO_MANY_APPLICATIONS"/>
- <element name="APPLICATION_REGISTERED_ALREADY"/>
- <element name="UNSUPPORTED_VERSION"/>
- <element name="WRONG_LANGUAGE"/>
- <element name="DISALLOWED"/>
- <element name="WARNINGS"/>
- <element name="RESUME_FAILED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
- <description>See SyncMsgVersion</description>
- </param>
-
- <param name="language" type="Language" mandatory="false">
- <description>The currently active VR+TTS language on Sync. See "Language" for options.</description>
- </param>
-
- <param name="hmiDisplayLanguage" type="Language" mandatory="false">
- <description>The currently active display language on Sync. See "Language" for options.</description>
- </param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </param>
-
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
- </param>
-
- <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <issue creator="rs">If not used yet => remove</issue>
- <description>See HmiZoneCapabilities</description>
- </param>
-
- <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See SpeechCapabilities</description>
- </param>
-
- <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See VrCapabilities</description>
- </param>
-
- <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See AudioPassThruCapability</description>
- </param>
-
- <param name="vehicleType" type="VehicleType" mandatory="false">
- <description>Specifies the vehicle's type. See VehicleType.</description>
- </param>
-
- <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See PrerecordedSpeech</description>
- </param>
-
- <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>
- Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests.
- If a mode outside this list is requested, it will be rejected.
- </description>
- </param>
- <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="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request">
- <description>Allows resetting global properties.</description>
-
- <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" >
- <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
- </param>
- </function>
-
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="AddCommand" functionID="AddCommandID" messagetype="request">
- <description>
- Adds a command to the in application menu.
- Either menuParams or vrCommands must be provided.
- </description>
-
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>unique ID of the command to add.</description>
- </param>
-
- <param name="menuParams" type="MenuParams" mandatory="false">
- <description>Optional sub value containing menu parameters</description>
- </param>
-
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false">
- <description>
- An array of strings to be used as VR synonyms for this command.
- If this array is provided, it may not be empty.
- </description>
- </param>
-
- <param name="cmdIcon" type="Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic icon.
- If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
- </description>
- </param>
-
- </function>
-
- <function name="AddCommand" functionID="AddCommandID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request">
- <description>Deletes all commands from the in-application menu with the specified command id.</description>
-
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>ID of the command(s) to delete.</description>
- </param>
-
- </function>
-
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request">
- <description>Adds a sub menu to the in-application menu.</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
- <description>unique ID of the sub menu to add.</description>
- </param>
-
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" defvalue="1000" mandatory="false">
- <description>
- Position within the items that are are at top level of the in application menu.
- 0 will insert at the front.
- 1 will insert at the second position.
- If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
- Position of any submenu will always be located before the return and exit options
- If this param was omitted the entry will be added at the end.
- </description>
- </param>
-
- <param name="menuName" maxlength="500" type="String">
- <description>Text to show in the menu for this sub menu.</description>
- </param>
- </function>
-
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request">
- <description>Deletes a submenu from the in-application menu.</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
- <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
- </param>
-
- </function>
-
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request">
- <description>creates interaction choice set to be used later by performInteraction</description>
-
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Unique ID used for this interaction choice set.</description>
- </param>
-
- <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" />
- </function>
-
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request">
- <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
-
- <param name="initialText" type="String" maxlength="500" >
- <description>Text to be displayed first.</description>
- </param>
-
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- This is the intial prompt spoken to the user at the start of an interaction.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="interactionMode" type="InteractionMode">
- <description>See InteractionMode.</description>
- </param>
-
- <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true">
- <description>List of interaction choice set IDs to use with an interaction.</description>
- </param>
-
- <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text. This is the spoken string when a user speaks "help" when the interaction is occuring.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Timeout text. This text is spoken when a VR interaction times out.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="false">
- <description>
- Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.
- Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform.
- </description>
- </param>
-
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
- If omitted on supported displays, the default SYNC generated list of suggested choices shall be displayed.
- </description>
- </param>
-
- <param name="interactionLayout" type="LayoutMode" mandatory="false">
- <description>See LayoutMode.</description>
- </param>
-
- </function>
-
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TIMED_OUT"/>
- <element name="ABORTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- ID of the choice that was selected in response to PerformInteraction.
- Only is valid if resultCode is SUCCESS.
- </description>
- </param>
-
- <param name="manualTextEntry" type="String" maxlength="500" mandatory="false">
- <description>
- Manually entered text selection, e.g. through keyboard
- Can be returned in lieu of choiceID, depending on trigger source
- </description>
- </param>
-
- <param name="triggerSource" type="TriggerSource" mandatory="false">
- <description>
- See TriggerSource
- Only is valid if resultCode is SUCCESS.
- </description>
- </param>
-
- </function>
-
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request">
- <description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
- <description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
-
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>ID of the interaction choice set to delete.</description>
- </param>
- </function>
-
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="Alert" functionID="AlertID" messagetype="request">
- <description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
-
- <param name="alertText1" type="String" maxlength="500" mandatory="false">
- <description>The first line of the alert text field</description>
- </param>
-
- <param name="alertText2" type="String" maxlength="500" mandatory="false">
- <description>The second line of the alert text field</description>
- </param>
-
- <param name="alertText3" type="String" maxlength="500" mandatory="false">
- <description>The optional third line of the alert text field</description>
- </param>
-
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="duration" type="Integer" minvalue="3000" maxvalue="10000" defvalue="5000" mandatory="false">
- <description>
- Timeout in milliseconds.
- Typical timeouts are 3-5 seconds.
- If omitted, timeout is set to 5s.
- </description>
- </param>
-
- <param name="playTone" type="Boolean" mandatory="false">
- <description>
- Defines if tone should be played. Tone is played before TTS.
- If omitted, no tone is played.
- </description>
- </param>
-
- <param name="progressIndicator" type="Boolean" mandatory="false" platform="MobileNav">
- <description>
- If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.
- </description>
- </param>
-
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, the displayed alert shall not have any SoftButtons.
- </description>
- </param>
-
- </function>
-
- <function name="Alert" functionID="AlertID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- Amount of time (in seconds) that an app must wait before resending an alert.
- If provided, another system event or overlay currently has a higher priority than this alert.
- An app must not send an alert without waiting at least the amount of time dictated.
- </description>
- </param>
-
- </function>
-
- <function name="Show" functionID="ShowID" messagetype="request">
- <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
-
- <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed in a single or upper display line.
- If this text is not set, the text of mainField1 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed on the second display line.
- If this text is not set, the text of mainField2 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed on the second "page" first display line.
- If this text is not set, the text of mainField3 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed on the second "page" second display line.
- If this text is not set, the text of mainField4 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="alignment" type="TextAlignment" mandatory="false">
- <description>
- Specifies how mainField1 and mainField2 texts should be aligned on display.
- If omitted, texts will be centered.
- </description>
- </param>
-
- <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
- </param>
-
- <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- Text value for MediaClock field. Has to be properly formatted by Mobile App according to Sync capabilities.
- If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
- </description>
- </param>
-
- <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed in the track field.
- This field is only valid for media applications on NGN type ACMs.
- If this text is not set, the text of mediaTrack stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="graphic" type="Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic image to display in app.
- If omitted on supported displays, the displayed graphic shall not change.
- </description>
- </param>
-
- <param name="secondaryGraphic" type="Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic secondary image to display in app.
- If omitted on supported displays, the displayed secondary graphic shall not change.
- </description>
- </param>
-
-
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, the currently displayed SoftButton values will not change.
- </description>
- </param>
-
- <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
- <description>
- App labeled on-screen presets (i.e. GEN2).
- If omitted on supported displays, the presets will be shown as not defined.
- </description>
- </param>
-
- </function>
-
- <function name="Show" functionID="ShowID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="Speak" functionID="SpeakID" messagetype="request">
- <description>Speaks a text.</description>
-
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true">
- <description>
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- </function>
-
- <function name="Speak" functionID="SpeakID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request">
- <description>Sets the initial media clock value and automatic update method.</description>
-
- <param name="startTime" type="StartTime" mandatory="false">
- <description>
- See StartTime.
- startTime must be provided for "COUNTUP" and "COUNTDOWN".
- startTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
- </description>
- </param>
-
- <param name="endTime" type="StartTime" mandatory="false">
- <description>
- See StartTime.
- endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
- If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
- endTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
- </description>
- </param>
-
- <param name="updateMode" type="UpdateMode" mandatory="true">
- <description>
- Enumeration to control the media clock.
- In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.
- </description>
- </param>
- </function>
-
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request">
- <description>Starts audio pass thru session </description>
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- SYNC will speak this prompt before opening the audio pass thru session.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- If omitted, then no initial prompt is spoken.
- </description>
- </param>
- <param name="audioPassThruDisplayText1" type="String" mandatory="false" maxlength="500">
- <description>First line of text displayed during audio capture.</description>
- </param>
- <param name="audioPassThruDisplayText2" type="String" mandatory="false" maxlength="500">
- <description>Second line of text displayed during audio capture.</description>
- </param>
- <param name="samplingRate" type="SamplingRate" mandatory="true">
- <description> This value shall be allowed at 8 khz or 16 or 22 or 44 khz.</description>
- </param>
- <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
- <description>The maximum duration of audio recording in milliseconds. </description>
- </param>
- <param name="bitsPerSample" type="BitsPerSample" mandatory="true">
- <description>Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.</description>
- </param>
- <param name="audioType" type="AudioType" mandatory="true">
- <description>Specifies the type of audio data being requested.</description>
- </param>
- <param name="muteAudio" type="Boolean" mandatory="false">
- <description>
- Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
- If omitted, the value is set to true.
- </description>
- </param>
- </function>
-
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="RETRY"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request">
- <description>When this request is invoked, the audio capture stops.</description>
- </function>
-
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request">
- <description>
- Subscribes to built-in HMI buttons.
- The application will be notified by the OnButtonEvent and OnButtonPress.
- To unsubscribe the notifications, use unsubscribeButton.
- </description>
-
- <param name="buttonName" type="ButtonName">
- <description>Name of the button to subscribe.</description>
- </param>
- </function>
-
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="UNSUPPORTED_RESOURCE" />
- <element name="IGNORED" />
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request">
- <description>Unsubscribes from built-in HMI buttons.</description>
-
- <param name="buttonName" type="ButtonName">
- <description>Name of the button to unsubscribe.</description>
- </param>
- </function>
-
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="UNSUPPORTED_RESOURCE" />
- <element name="IGNORED" />
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request">
- <description>
- Subscribes for specific published data items.
- The data will be only sent if it has changed.
- The application will be notified by the onVehicleData notification whenever new data is available.
- To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
- </description>
-
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
-
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="WARNINGS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="IGNORED" />
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request">
- <description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</description>
-
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="WARNINGS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="IGNORED" />
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="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"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
- <description>
- Current slider value returned when saved or canceled (aborted)
- This value is only returned for resultCodes "SAVED" or "ABORTED"
- </description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request">
- <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="turnIcon" type="Image" mandatory="false">
- </param>
- <param name="nextTurnIcon" type="Image" mandatory="false">
- </param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
- <description>
- Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).
- Used to calculate progress bar.
- </description>
- </param>
- <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
- <description>
- Distance till next maneuver (starting from) from previous maneuver.
- Used to calculate progress bar.
- </description>
- </param>
- <param name="maneuverComplete" type="Boolean" mandatory="false">
- <description>
- If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay.
- If omitted the value will be assumed as FALSE.
- </description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>
- Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
- If omitted on supported displays, the currently displayed SoftButton values will not change.
- </description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request">
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed.</description>
- </param>
- </function>
-
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request">
- <param name="turnList" type="Turn" minsize="1" maxsize="100" array="true" mandatory="false">
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
- <description>If omitted on supported displays, app-defined SoftButton will be left blank.</description>
- </param>
- </function>
-
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request">
- <param name="language" type="Language" mandatory="true">
- <description>Requested voice engine (VR+TTS) language registration</description>
- </param>
- <param name="hmiDisplayLanguage" type="Language" mandatory="true">
- <description>Request display language registration</description>
- </param>
- <param name="appName" type="String" maxlength="100" mandatory="false">
- <description>Request new app name registration</description>
- </param>
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>Request new ttsName registration</description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Request new app short name registration</description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Request new VR synonyms registration</description>
- </param>
-
-</function>
-
-
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description>
- true, if successful
- false, if failed
- </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="DUPLICATE_NAME"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="GenericResponse" functionID="GenericResponseID" messagetype="response">
- <description>
- Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.
- Currently, only resultCode INVALID_DATA is used.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="INVALID_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PutFile" functionID="PutFileID" messagetype="request">
- <description>
- Used to push a binary data onto the SYNC module from a mobile device, such as icons and album art
- Not supported on first generation SYNC vehicles.
- Binary data is in binary part of hybrid msg.
- </description>
-
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- <param name="fileType" type="FileType" mandatory="true">
- <description>Selected file type.</description>
- </param>
-
- <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
- <description>
- Indicates if the file is meant to persist between sessions / ignition cycles.
- If set to TRUE, then the system will aim to persist this file through session / cycles.
- While files with this designation will have priority over others, they are subject to deletion by the system at any time.
- In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
- If omitted, the value will be set to false.
- </description>
- </param>
-
- <param name="systemFile" type="Boolean" defvalue="false" mandatory="false">
- <description>Indicates if the file is meant to be passed thru core to elsewhere on the system.
- If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core. If omitted, the value will be set to false.</description>
- </param>
-
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
-
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
-
- </function>
-
- <function name="PutFile" functionID="PutFileID" messagetype="response">
- <description>Response is sent, when the file data was copied (success case). Or when an error occured.</description>
- <description>Not supported on First generation SYNC vehicles. </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>
- Provides the total local space available on SYNC for the registered app.
- If the transfer has systemFile enabled, then the value will be set to 0 automatically.
- </description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="request">
- <description>
- Used to delete a file resident on the SYNC module in the app's local cache.
- Not supported on first generation SYNC vehicles.
- </description>
-
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- </function>
-
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="response">
- <description>
- Response is sent, when the file data was deleted (success case). Or when an error occured.
- Not supported on First generation SYNC vehicles.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Provides the total local space available on SYNC for the registered app.</description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ListFiles" functionID="ListFilesID" messagetype="request">
- <description>
- Requests the current list of resident filenames for the registered app.
- Not supported on first generation SYNC vehicles.
- </description>
- </function>
-
- <function name="ListFiles" functionID="ListFilesID" messagetype="response">
- <description>
- Returns the current list of resident filenames for the registered app along with the current space available
- Not supported on First generation SYNC vehicles.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="filenames" type="String" maxlength="500" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>
- An array of all filenames resident on SYNC for the given registered app.
- If omitted, then no files currently reside on the system.
- </description>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Provides the total local space available on SYNC for the registered app.</description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request">
- <description>
- Used to set existing local file on SYNC as the app's icon
- Not supported on first generation SYNC vehicles.
- </description>
-
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- </function>
-
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response">
- <description>
- Response is sent, when the file data was copied (success case). Or when an error occured.
- Not supported on First generation SYNC vehicles.
- </description>
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request">
- <description>
- Used to set an alternate display layout.
- If not sent, default screen for given platform will be shown
- </description>
-
- <param name="displayLayout" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined screen layouts are defined.
- </description>
- </param>
- </function>
-
- <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification">
- <description>
- Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
- Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
- </description>
-
- <param name="hashID" type="String" maxlength="100" mandatory="true">
- <description>Calculated hash ID to be referenced during RegisterAppInterface.</description>
- </param>
- </function>
-
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </param>
-
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="request">
- <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as Authentication requests)</description>
- <param name="requestType" type="RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="fileName" type="String" maxlength="255" mandatory="false">
- <description>The name of file.</description>
- </param>
- </function>
-
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_CERT"/>
- <element name="EXPIRED_CERT"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- <element name="TIMED_OUT"/>
- <element name="IGNORED"/>
- </param>
- </function>
-
- <function name="SendLocation" functionID="SendLocationID" messagetype="request">
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description>
- Name / title of intended location
- </description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description>
- Description intended location / establishment (if applicable)
- </description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>
- Location address (if applicable)
- </description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description>
- Phone number of intended location / establishment (if applicable)
- </description>
- </param>
- <param name="locationImage" type="Image" mandatory="false">
- <description>
- Image / icon of intended location (if applicable and supported)
- </description>
- </param>
- </function>
-
- <function name="SendLocation" functionID="SendLocationID" messagetype="response" >
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- </param>
- </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.</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" platform="MobileNav">
-
- <description>On-screen keyboard event.</description>
- <description>Can be full string or individual keypresses depending on keyboard mode.</description>
-
- <param name="event" type="KeyboardEvent" mandatory="true">
- <description>On-screen keyboard input data.</description>
- </param>
-
- <param name="data" type="String" maxlength="500" mandatory="false">
- <description>On-screen keyboard input data.</description>
- <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
- <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
- <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
- </param>
-
- </function>
-
-
- <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" platform="MobileNav">
- <description>Notifies about touch events on the screen's prescribed area</description>
- <param name="type" type="TouchType" mandatory="true">
- <description>The type of touch event.</description>
- </param>
- <param name="event" type="TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
- <description>List of all individual touches involved in this event.</description>
- </param>
- </function>
-
- <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification">
- <description>
- An asynchronous request from the system for specific data from the device or the cloud or response
- to a request from the device or cloud Binary data can be included in hybrid part of message for some requests
- (such as Authentication request responses)
- </description>
- <param name="requestType" type="RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="url" type="String" maxlength="1000" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Optional array of URL(s) for HTTP requests.
- If blank, the binary data shall be forwarded to the app.
- If not blank, the binary data shall be forwarded to the url(s) with a provided timeout in seconds.
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- Optional timeout for HTTP requests
- Required if a URL is provided
- </description>
- </param>
- <param name="fileType" type="FileType" mandatory="false">
- <description>Optional file type (meant for HTTP file requests).</description>
- </param>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- </function>
-
-<!-- ~~~~~~~~~~~~~~~~~~ -->
-<!-- Ford Specific APIs -->
-<!-- ~~~~~~~~~~~~~~~~~~ -->
-</interface>
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
diff --git a/src/components/utils/test/timer_test.cc b/src/components/utils/test/timer_test.cc
index 63b3c663c3..ea5c9f0b84 100644
--- a/src/components/utils/test/timer_test.cc
+++ b/src/components/utils/test/timer_test.cc
@@ -47,12 +47,11 @@ sync_primitives::Lock shot_lock;
sync_primitives::ConditionalVariable shot_condition;
const std::string kTimerName = "TestTimer";
-const bool kSingleShot = true;
/*
* Default timeout used during timer testing.
* Value should be greater than at least 30 ms
- * to avoid timer firing beetwen two sequental Start/Stop calls
+ * to avoid timer firing between two sequental Start/Stop calls
*/
const uint32_t kDefaultTimeoutMs = 30u;
const uint32_t kDefaultTimeoutRestartMs = 45u;
@@ -87,7 +86,7 @@ class TestTaskWithStart : public TestTask {
public:
void PerformTimer() const OVERRIDE {
if (timer_) {
- timer_->Start(kDefaultTimeoutRestartMs, !kSingleShot);
+ timer_->Start(kDefaultTimeoutRestartMs, timer::kPeriodic);
}
}
};
@@ -113,7 +112,7 @@ TEST(TimerTest, Start_Stop_NoLoop_NoCall) {
EXPECT_FALSE(timer.is_running());
EXPECT_EQ(0u, timer.timeout());
- timer.Start(kDefaultTimeoutMs, kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kSingleShot);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
@@ -130,7 +129,7 @@ TEST(TimerTest, Start_Stop_Loop_NoCall) {
EXPECT_FALSE(timer.is_running());
EXPECT_EQ(0u, timer.timeout());
- timer.Start(kDefaultTimeoutMs, !kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kPeriodic);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
@@ -147,7 +146,7 @@ TEST(TimerTest, Start_Stop_NoLoop_OneCall) {
EXPECT_FALSE(timer.is_running());
EXPECT_EQ(0u, timer.timeout());
- timer.Start(kDefaultTimeoutMs, kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kSingleShot);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
@@ -172,7 +171,7 @@ TEST(TimerTest, Start_Stop_Loop_3Calls) {
EXPECT_FALSE(timer.is_running());
EXPECT_EQ(0u, timer.timeout());
- timer.Start(kDefaultTimeoutMs, !kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kPeriodic);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
@@ -197,11 +196,11 @@ TEST(TimerTest, Restart_NoLoop_NoCall) {
timer::Timer timer(kTimerName, mock_task);
- timer.Start(kDefaultTimeoutMs, kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kSingleShot);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
- timer.Start(kDefaultTimeoutRestartMs, kSingleShot);
+ timer.Start(kDefaultTimeoutRestartMs, timer::kSingleShot);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutRestartMs, timer.timeout());
}
@@ -212,11 +211,11 @@ TEST(TimerTest, Restart_Loop_NoCall) {
timer::Timer timer(kTimerName, mock_task);
- timer.Start(kDefaultTimeoutMs, !kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kPeriodic);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
- timer.Start(kDefaultTimeoutRestartMs, !kSingleShot);
+ timer.Start(kDefaultTimeoutRestartMs, timer::kPeriodic);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutRestartMs, timer.timeout());
}
@@ -228,7 +227,7 @@ TEST(TimerTest, Restart_Loop_3Calls) {
TestTask* task = new TestTask();
timer::Timer timer(kTimerName, task);
- timer.Start(kDefaultTimeoutMs, !kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kPeriodic);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
@@ -236,7 +235,7 @@ TEST(TimerTest, Restart_Loop_3Calls) {
for (size_t i = 0; i < loops_count; ++i) {
shot_condition.Wait(shot_lock);
}
- timer.Start(kDefaultTimeoutRestartMs, !kSingleShot);
+ timer.Start(kDefaultTimeoutRestartMs, timer::kPeriodic);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutRestartMs, timer.timeout());
@@ -251,7 +250,7 @@ TEST(TimerTest, Restart_NoLoop_FromCall) {
timer::Timer timer(kTimerName, task);
task->set_timer(&timer);
- timer.Start(kDefaultTimeoutMs, kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kSingleShot);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
@@ -270,7 +269,7 @@ TEST(TimerTest, Restart_Loop_FromCall) {
timer::Timer timer(kTimerName, task);
task->set_timer(&timer);
- timer.Start(kDefaultTimeoutMs, !kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kPeriodic);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
@@ -291,7 +290,7 @@ TEST(TimerTest, Stop_Loop_FromCall) {
timer::Timer timer(kTimerName, task);
task->set_timer(&timer);
- timer.Start(kDefaultTimeoutMs, !kSingleShot);
+ timer.Start(kDefaultTimeoutMs, timer::kPeriodic);
EXPECT_TRUE(timer.is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer.timeout());
@@ -314,7 +313,7 @@ TEST(TimerTest, Delete_Running_NoLoop) {
EXPECT_FALSE(timer->is_running());
EXPECT_EQ(0u, timer->timeout());
- timer->Start(kDefaultTimeoutMs, kSingleShot);
+ timer->Start(kDefaultTimeoutMs, timer::kSingleShot);
EXPECT_TRUE(timer->is_running());
EXPECT_EQ(kDefaultTimeoutMs, timer->timeout());
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 1a4eff13b5..4b6f6d8dfa 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -29,5 +29,5 @@
# POSSIBILITY OF SUCH DAMAGE.
if(ENABLE_LOG)
-add_subdirectory(appenders)
+ add_subdirectory(appenders)
endif()
diff --git a/src/plugins/appenders/CMakeLists.txt b/src/plugins/appenders/CMakeLists.txt
index 9d01599ca3..3d18e62503 100644
--- a/src/plugins/appenders/CMakeLists.txt
+++ b/src/plugins/appenders/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,22 +28,24 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-SET(target "appenders")
-
-SET(SOURCES
- safe_file_appender.cc
- safe_rolling_file_appender.cc
-)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
${LOG4CXX_INCLUDE_DIRECTORY}
)
-add_library(${target} MODULE ${SOURCES})
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+
+set(LIBRARIES
+ log4cxx -L${LOG4CXX_LIBS_DIRECTORY}
+)
+
+add_library(appenders SHARED ${SOURCES})
+target_link_libraries(appenders ${LIBRARIES})
-target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+add_dependencies(appenders install-3rd_party_logger)
-install(TARGETS ${target}
+install(TARGETS appenders
DESTINATION bin
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
diff --git a/tools/InterfaceGenerator/MsgVersionGenerate.py b/tools/InterfaceGenerator/MsgVersionGenerate.py
index 7ff6c384d3..86251cd419 100644
--- a/tools/InterfaceGenerator/MsgVersionGenerate.py
+++ b/tools/InterfaceGenerator/MsgVersionGenerate.py
@@ -8,7 +8,7 @@ from generator.parsers import RPCBase
def generate_msg_version(file_name, path_to_storage):
"""Parses MOBILE_API.xml in order to
- receive major_version and minor_version
+ receive major_version, minor_version, and patch_version
"""
tree = xml.etree.ElementTree.parse(file_name)
root = tree.getroot()
@@ -17,8 +17,9 @@ def generate_msg_version(file_name, path_to_storage):
array = (root.attrib["version"]).split(".")
major_version = array[0]
minor_version = array[1]
- if (major_version.isdigit() and minor_version.isdigit()):
- data_for_storage = prepare_data_for_storage(major_version, minor_version)
+ patch_version = array[2]
+ if (major_version.isdigit() and minor_version.isdigit() and patch_version.isdigit):
+ data_for_storage = prepare_data_for_storage(major_version, minor_version, patch_version)
store_data_to_file(path_to_storage, data_for_storage)
else:
raise RPCBase.ParseError("Attribute version has incorect value in MOBILE_API.xml")
@@ -38,13 +39,13 @@ def store_data_to_file(path_to_storage, data_for_storage):
def check_version_format(version):
"""Checks correctness of format of version
"""
- p = re.compile('\d+\\.\d+')
+ p = re.compile('\d+\\.\d+\\.\d+')
result = p.match(version)
if result == None or (result.end() != len(version)):
raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
- "Need format of version major_version.minor_version")
+ "Need format of version major_version.minor_version.patch_version")
-def prepare_data_for_storage(major_version, minor_version):
+def prepare_data_for_storage(major_version, minor_version, patch_version):
"""Prepares data to store to file.
"""
temp = Template(
@@ -78,8 +79,9 @@ def prepare_data_for_storage(major_version, minor_version):
u'''namespace application_manager {\n\n'''
u'''const uint16_t major_version = $m_version;\n'''
u'''const uint16_t minor_version = $min_version;\n'''
+ u'''const uint16_t patch_version = $p_version;\n'''
u'''} // namespace application_manager\n'''
u'''#endif // GENERATED_MSG_VERSION_H''')
- data_to_file = temp.substitute(m_version = major_version, min_version = minor_version)
+ data_to_file = temp.substitute(m_version = major_version, min_version = minor_version, p_version = patch_version)
return data_to_file
diff --git a/tools/cmake/helpers/cotire.cmake b/tools/cmake/helpers/cotire.cmake
new file mode 100644
index 0000000000..741d6901f1
--- /dev/null
+++ b/tools/cmake/helpers/cotire.cmake
@@ -0,0 +1,3917 @@
+# - cotire (compile time reducer)
+#
+# See the cotire manual for usage hints.
+#
+#=============================================================================
+# Copyright 2012-2016 Sascha Kratky
+#
+# 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.
+#=============================================================================
+
+if(__COTIRE_INCLUDED)
+ return()
+endif()
+set(__COTIRE_INCLUDED TRUE)
+
+# call cmake_minimum_required, but prevent modification of the CMake policy stack in include mode
+# cmake_minimum_required also sets the policy version as a side effect, which we have to avoid
+if (NOT CMAKE_SCRIPT_MODE_FILE)
+ cmake_policy(PUSH)
+endif()
+cmake_minimum_required(VERSION 2.8.12)
+if (NOT CMAKE_SCRIPT_MODE_FILE)
+ cmake_policy(POP)
+endif()
+
+set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
+set (COTIRE_CMAKE_MODULE_VERSION "1.7.8")
+
+# activate select policies
+if (POLICY CMP0025)
+ # Compiler id for Apple Clang is now AppleClang
+ cmake_policy(SET CMP0025 NEW)
+endif()
+
+if (POLICY CMP0026)
+ # disallow use of the LOCATION target property
+ cmake_policy(SET CMP0026 NEW)
+endif()
+
+if (POLICY CMP0038)
+ # targets may not link directly to themselves
+ cmake_policy(SET CMP0038 NEW)
+endif()
+
+if (POLICY CMP0039)
+ # utility targets may not have link dependencies
+ cmake_policy(SET CMP0039 NEW)
+endif()
+
+if (POLICY CMP0040)
+ # target in the TARGET signature of add_custom_command() must exist
+ cmake_policy(SET CMP0040 NEW)
+endif()
+
+if (POLICY CMP0045)
+ # error on non-existent target in get_target_property
+ cmake_policy(SET CMP0045 NEW)
+endif()
+
+if (POLICY CMP0046)
+ # error on non-existent dependency in add_dependencies
+ cmake_policy(SET CMP0046 NEW)
+endif()
+
+if (POLICY CMP0049)
+ # do not expand variables in target source entries
+ cmake_policy(SET CMP0049 NEW)
+endif()
+
+if (POLICY CMP0050)
+ # disallow add_custom_command SOURCE signatures
+ cmake_policy(SET CMP0050 NEW)
+endif()
+
+if (POLICY CMP0051)
+ # include TARGET_OBJECTS expressions in a target's SOURCES property
+ cmake_policy(SET CMP0051 NEW)
+endif()
+
+if (POLICY CMP0053)
+ # simplify variable reference and escape sequence evaluation
+ cmake_policy(SET CMP0053 NEW)
+endif()
+
+if (POLICY CMP0054)
+ # only interpret if() arguments as variables or keywords when unquoted
+ cmake_policy(SET CMP0054 NEW)
+endif()
+
+include(CMakeParseArguments)
+include(ProcessorCount)
+
+function (cotire_get_configuration_types _configsVar)
+ set (_configs "")
+ if (CMAKE_CONFIGURATION_TYPES)
+ list (APPEND _configs ${CMAKE_CONFIGURATION_TYPES})
+ endif()
+ if (CMAKE_BUILD_TYPE)
+ list (APPEND _configs "${CMAKE_BUILD_TYPE}")
+ endif()
+ if (_configs)
+ list (REMOVE_DUPLICATES _configs)
+ set (${_configsVar} ${_configs} PARENT_SCOPE)
+ else()
+ set (${_configsVar} "None" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function (cotire_get_source_file_extension _sourceFile _extVar)
+ # get_filename_component returns extension from first occurrence of . in file name
+ # this function computes the extension from last occurrence of . in file name
+ string (FIND "${_sourceFile}" "." _index REVERSE)
+ if (_index GREATER -1)
+ math (EXPR _index "${_index} + 1")
+ string (SUBSTRING "${_sourceFile}" ${_index} -1 _sourceExt)
+ else()
+ set (_sourceExt "")
+ endif()
+ set (${_extVar} "${_sourceExt}" PARENT_SCOPE)
+endfunction()
+
+macro (cotire_check_is_path_relative_to _path _isRelativeVar)
+ set (${_isRelativeVar} FALSE)
+ if (IS_ABSOLUTE "${_path}")
+ foreach (_dir ${ARGN})
+ file (RELATIVE_PATH _relPath "${_dir}" "${_path}")
+ if (NOT _relPath OR (NOT IS_ABSOLUTE "${_relPath}" AND NOT "${_relPath}" MATCHES "^\\.\\."))
+ set (${_isRelativeVar} TRUE)
+ break()
+ endif()
+ endforeach()
+ endif()
+endmacro()
+
+function (cotire_filter_language_source_files _language _target _sourceFilesVar _excludedSourceFilesVar _cotiredSourceFilesVar)
+ if (CMAKE_${_language}_SOURCE_FILE_EXTENSIONS)
+ set (_languageExtensions "${CMAKE_${_language}_SOURCE_FILE_EXTENSIONS}")
+ else()
+ set (_languageExtensions "")
+ endif()
+ if (CMAKE_${_language}_IGNORE_EXTENSIONS)
+ set (_ignoreExtensions "${CMAKE_${_language}_IGNORE_EXTENSIONS}")
+ else()
+ set (_ignoreExtensions "")
+ endif()
+ if (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS)
+ set (_excludeExtensions "${COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS}")
+ else()
+ set (_excludeExtensions "")
+ endif()
+ if (COTIRE_DEBUG AND _languageExtensions)
+ message (STATUS "${_language} source file extensions: ${_languageExtensions}")
+ endif()
+ if (COTIRE_DEBUG AND _ignoreExtensions)
+ message (STATUS "${_language} ignore extensions: ${_ignoreExtensions}")
+ endif()
+ if (COTIRE_DEBUG AND _excludeExtensions)
+ message (STATUS "${_language} exclude extensions: ${_excludeExtensions}")
+ endif()
+ if (CMAKE_VERSION VERSION_LESS "3.1.0")
+ set (_allSourceFiles ${ARGN})
+ else()
+ # as of CMake 3.1 target sources may contain generator expressions
+ # since we cannot obtain required property information about source files added
+ # through generator expressions at configure time, we filter them out
+ string (GENEX_STRIP "${ARGN}" _allSourceFiles)
+ endif()
+ set (_filteredSourceFiles "")
+ set (_excludedSourceFiles "")
+ foreach (_sourceFile ${_allSourceFiles})
+ get_source_file_property(_sourceIsHeaderOnly "${_sourceFile}" HEADER_FILE_ONLY)
+ get_source_file_property(_sourceIsExternal "${_sourceFile}" EXTERNAL_OBJECT)
+ get_source_file_property(_sourceIsSymbolic "${_sourceFile}" SYMBOLIC)
+ if (NOT _sourceIsHeaderOnly AND NOT _sourceIsExternal AND NOT _sourceIsSymbolic)
+ cotire_get_source_file_extension("${_sourceFile}" _sourceExt)
+ if (_sourceExt)
+ list (FIND _ignoreExtensions "${_sourceExt}" _ignoreIndex)
+ if (_ignoreIndex LESS 0)
+ list (FIND _excludeExtensions "${_sourceExt}" _excludeIndex)
+ if (_excludeIndex GREATER -1)
+ list (APPEND _excludedSourceFiles "${_sourceFile}")
+ else()
+ list (FIND _languageExtensions "${_sourceExt}" _sourceIndex)
+ if (_sourceIndex GREATER -1)
+ # consider source file unless it is excluded explicitly
+ get_source_file_property(_sourceIsExcluded "${_sourceFile}" COTIRE_EXCLUDED)
+ if (_sourceIsExcluded)
+ list (APPEND _excludedSourceFiles "${_sourceFile}")
+ else()
+ list (APPEND _filteredSourceFiles "${_sourceFile}")
+ endif()
+ else()
+ get_source_file_property(_sourceLanguage "${_sourceFile}" LANGUAGE)
+ if ("${_sourceLanguage}" STREQUAL "${_language}")
+ # add to excluded sources, if file is not ignored and has correct language without having the correct extension
+ list (APPEND _excludedSourceFiles "${_sourceFile}")
+ endif()
+ endif()
+ endif()
+ endif()
+ endif()
+ endif()
+ endforeach()
+ # separate filtered source files from already cotired ones
+ # the COTIRE_TARGET property of a source file may be set while a target is being processed by cotire
+ set (_sourceFiles "")
+ set (_cotiredSourceFiles "")
+ foreach (_sourceFile ${_filteredSourceFiles})
+ get_source_file_property(_sourceIsCotired "${_sourceFile}" COTIRE_TARGET)
+ if (_sourceIsCotired)
+ list (APPEND _cotiredSourceFiles "${_sourceFile}")
+ else()
+ get_source_file_property(_sourceCompileFlags "${_sourceFile}" COMPILE_FLAGS)
+ if (_sourceCompileFlags)
+ # add to excluded sources, if file has custom compile flags
+ list (APPEND _excludedSourceFiles "${_sourceFile}")
+ else()
+ list (APPEND _sourceFiles "${_sourceFile}")
+ endif()
+ endif()
+ endforeach()
+ if (COTIRE_DEBUG)
+ if (_sourceFiles)
+ message (STATUS "Filtered ${_target} ${_language} sources: ${_sourceFiles}")
+ endif()
+ if (_excludedSourceFiles)
+ message (STATUS "Excluded ${_target} ${_language} sources: ${_excludedSourceFiles}")
+ endif()
+ if (_cotiredSourceFiles)
+ message (STATUS "Cotired ${_target} ${_language} sources: ${_cotiredSourceFiles}")
+ endif()
+ endif()
+ set (${_sourceFilesVar} ${_sourceFiles} PARENT_SCOPE)
+ set (${_excludedSourceFilesVar} ${_excludedSourceFiles} PARENT_SCOPE)
+ set (${_cotiredSourceFilesVar} ${_cotiredSourceFiles} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_objects_with_property_on _filteredObjectsVar _property _type)
+ set (_filteredObjects "")
+ foreach (_object ${ARGN})
+ get_property(_isSet ${_type} "${_object}" PROPERTY ${_property} SET)
+ if (_isSet)
+ get_property(_propertyValue ${_type} "${_object}" PROPERTY ${_property})
+ if (_propertyValue)
+ list (APPEND _filteredObjects "${_object}")
+ endif()
+ endif()
+ endforeach()
+ set (${_filteredObjectsVar} ${_filteredObjects} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_objects_with_property_off _filteredObjectsVar _property _type)
+ set (_filteredObjects "")
+ foreach (_object ${ARGN})
+ get_property(_isSet ${_type} "${_object}" PROPERTY ${_property} SET)
+ if (_isSet)
+ get_property(_propertyValue ${_type} "${_object}" PROPERTY ${_property})
+ if (NOT _propertyValue)
+ list (APPEND _filteredObjects "${_object}")
+ endif()
+ endif()
+ endforeach()
+ set (${_filteredObjectsVar} ${_filteredObjects} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_file_property_values _valuesVar _property)
+ set (_values "")
+ foreach (_sourceFile ${ARGN})
+ get_source_file_property(_propertyValue "${_sourceFile}" ${_property})
+ if (_propertyValue)
+ list (APPEND _values "${_propertyValue}")
+ endif()
+ endforeach()
+ set (${_valuesVar} ${_values} PARENT_SCOPE)
+endfunction()
+
+function (cotire_resolve_config_properites _configurations _propertiesVar)
+ set (_properties "")
+ foreach (_property ${ARGN})
+ if ("${_property}" MATCHES "<CONFIG>")
+ foreach (_config ${_configurations})
+ string (TOUPPER "${_config}" _upperConfig)
+ string (REPLACE "<CONFIG>" "${_upperConfig}" _configProperty "${_property}")
+ list (APPEND _properties ${_configProperty})
+ endforeach()
+ else()
+ list (APPEND _properties ${_property})
+ endif()
+ endforeach()
+ set (${_propertiesVar} ${_properties} PARENT_SCOPE)
+endfunction()
+
+function (cotire_copy_set_properites _configurations _type _source _target)
+ cotire_resolve_config_properites("${_configurations}" _properties ${ARGN})
+ foreach (_property ${_properties})
+ get_property(_isSet ${_type} ${_source} PROPERTY ${_property} SET)
+ if (_isSet)
+ get_property(_propertyValue ${_type} ${_source} PROPERTY ${_property})
+ set_property(${_type} ${_target} PROPERTY ${_property} "${_propertyValue}")
+ endif()
+ endforeach()
+endfunction()
+
+function (cotire_get_target_usage_requirements _target _targetRequirementsVar)
+ set (_targetRequirements "")
+ get_target_property(_librariesToProcess ${_target} LINK_LIBRARIES)
+ while (_librariesToProcess)
+ # remove from head
+ list (GET _librariesToProcess 0 _library)
+ list (REMOVE_AT _librariesToProcess 0)
+ if (TARGET ${_library})
+ list (FIND _targetRequirements ${_library} _index)
+ if (_index LESS 0)
+ list (APPEND _targetRequirements ${_library})
+ # BFS traversal of transitive libraries
+ get_target_property(_libraries ${_library} INTERFACE_LINK_LIBRARIES)
+ if (_libraries)
+ list (APPEND _librariesToProcess ${_libraries})
+ list (REMOVE_DUPLICATES _librariesToProcess)
+ endif()
+ endif()
+ endif()
+ endwhile()
+ set (${_targetRequirementsVar} ${_targetRequirements} PARENT_SCOPE)
+endfunction()
+
+function (cotire_filter_compile_flags _language _flagFilter _matchedOptionsVar _unmatchedOptionsVar)
+ if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+ set (_flagPrefix "[/-]")
+ else()
+ set (_flagPrefix "--?")
+ endif()
+ set (_optionFlag "")
+ set (_matchedOptions "")
+ set (_unmatchedOptions "")
+ foreach (_compileFlag ${ARGN})
+ if (_compileFlag)
+ if (_optionFlag AND NOT "${_compileFlag}" MATCHES "^${_flagPrefix}")
+ # option with separate argument
+ list (APPEND _matchedOptions "${_compileFlag}")
+ set (_optionFlag "")
+ elseif ("${_compileFlag}" MATCHES "^(${_flagPrefix})(${_flagFilter})$")
+ # remember option
+ set (_optionFlag "${CMAKE_MATCH_2}")
+ elseif ("${_compileFlag}" MATCHES "^(${_flagPrefix})(${_flagFilter})(.+)$")
+ # option with joined argument
+ list (APPEND _matchedOptions "${CMAKE_MATCH_3}")
+ set (_optionFlag "")
+ else()
+ # flush remembered option
+ if (_optionFlag)
+ list (APPEND _matchedOptions "${_optionFlag}")
+ set (_optionFlag "")
+ endif()
+ # add to unfiltered options
+ list (APPEND _unmatchedOptions "${_compileFlag}")
+ endif()
+ endif()
+ endforeach()
+ if (_optionFlag)
+ list (APPEND _matchedOptions "${_optionFlag}")
+ endif()
+ if (COTIRE_DEBUG AND _matchedOptions)
+ message (STATUS "Filter ${_flagFilter} matched: ${_matchedOptions}")
+ endif()
+ if (COTIRE_DEBUG AND _unmatchedOptions)
+ message (STATUS "Filter ${_flagFilter} unmatched: ${_unmatchedOptions}")
+ endif()
+ set (${_matchedOptionsVar} ${_matchedOptions} PARENT_SCOPE)
+ set (${_unmatchedOptionsVar} ${_unmatchedOptions} PARENT_SCOPE)
+endfunction()
+
+function (cotire_is_target_supported _target _isSupportedVar)
+ if (NOT TARGET "${_target}")
+ set (${_isSupportedVar} FALSE PARENT_SCOPE)
+ return()
+ endif()
+ get_target_property(_imported ${_target} IMPORTED)
+ if (_imported)
+ set (${_isSupportedVar} FALSE PARENT_SCOPE)
+ return()
+ endif()
+ get_target_property(_targetType ${_target} TYPE)
+ if (NOT _targetType MATCHES "EXECUTABLE|(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+ set (${_isSupportedVar} FALSE PARENT_SCOPE)
+ return()
+ endif()
+ set (${_isSupportedVar} TRUE PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_compile_flags _config _language _target _flagsVar)
+ string (TOUPPER "${_config}" _upperConfig)
+ # collect options from CMake language variables
+ set (_compileFlags "")
+ if (CMAKE_${_language}_FLAGS)
+ set (_compileFlags "${_compileFlags} ${CMAKE_${_language}_FLAGS}")
+ endif()
+ if (CMAKE_${_language}_FLAGS_${_upperConfig})
+ set (_compileFlags "${_compileFlags} ${CMAKE_${_language}_FLAGS_${_upperConfig}}")
+ endif()
+ if (_target)
+ # add target compile flags
+ get_target_property(_targetflags ${_target} COMPILE_FLAGS)
+ if (_targetflags)
+ set (_compileFlags "${_compileFlags} ${_targetflags}")
+ endif()
+ endif()
+ if (UNIX)
+ separate_arguments(_compileFlags UNIX_COMMAND "${_compileFlags}")
+ elseif(WIN32)
+ separate_arguments(_compileFlags WINDOWS_COMMAND "${_compileFlags}")
+ else()
+ separate_arguments(_compileFlags)
+ endif()
+ # target compile options
+ if (_target)
+ get_target_property(_targetOptions ${_target} COMPILE_OPTIONS)
+ if (_targetOptions)
+ list (APPEND _compileFlags ${_targetOptions})
+ endif()
+ endif()
+ # interface compile options from linked library targets
+ if (_target)
+ set (_linkedTargets "")
+ cotire_get_target_usage_requirements(${_target} _linkedTargets)
+ foreach (_linkedTarget ${_linkedTargets})
+ get_target_property(_targetOptions ${_linkedTarget} INTERFACE_COMPILE_OPTIONS)
+ if (_targetOptions)
+ list (APPEND _compileFlags ${_targetOptions})
+ endif()
+ endforeach()
+ endif()
+ # handle language standard properties
+ if (_target)
+ get_target_property(_targetLanguageStandard ${_target} ${_language}_STANDARD)
+ get_target_property(_targetLanguageExtensions ${_target} ${_language}_EXTENSIONS)
+ get_target_property(_targetLanguageStandardRequired ${_target} ${_language}_STANDARD_REQUIRED)
+ if (_targetLanguageExtensions)
+ if (CMAKE_${_language}${_targetLanguageExtensions}_EXTENSION_COMPILE_OPTION)
+ list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageExtensions}_EXTENSION_COMPILE_OPTION}")
+ endif()
+ elseif (_targetLanguageStandard)
+ if (_targetLanguageStandardRequired)
+ if (CMAKE_${_language}${_targetLanguageStandard}_STANDARD_COMPILE_OPTION)
+ list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_STANDARD_COMPILE_OPTION}")
+ endif()
+ else()
+ if (CMAKE_${_language}${_targetLanguageStandard}_EXTENSION_COMPILE_OPTION)
+ list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_EXTENSION_COMPILE_OPTION}")
+ endif()
+ endif()
+ endif()
+ endif()
+ # handle the POSITION_INDEPENDENT_CODE target property
+ if (_target)
+ get_target_property(_targetPIC ${_target} POSITION_INDEPENDENT_CODE)
+ if (_targetPIC)
+ get_target_property(_targetType ${_target} TYPE)
+ if (_targetType STREQUAL "EXECUTABLE" AND CMAKE_${_language}_COMPILE_OPTIONS_PIE)
+ list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_PIE}")
+ elseif (CMAKE_${_language}_COMPILE_OPTIONS_PIC)
+ list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_PIC}")
+ endif()
+ endif()
+ endif()
+ # handle visibility target properties
+ if (_target)
+ get_target_property(_targetVisibility ${_target} ${_language}_VISIBILITY_PRESET)
+ if (_targetVisibility AND CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY)
+ list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY}${_targetVisibility}")
+ endif()
+ get_target_property(_targetVisibilityInlines ${_target} VISIBILITY_INLINES_HIDDEN)
+ if (_targetVisibilityInlines AND CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN)
+ list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}")
+ endif()
+ endif()
+ # platform specific flags
+ if (APPLE)
+ get_target_property(_architectures ${_target} OSX_ARCHITECTURES_${_upperConfig})
+ if (NOT _architectures)
+ get_target_property(_architectures ${_target} OSX_ARCHITECTURES)
+ endif()
+ if (_architectures)
+ foreach (_arch ${_architectures})
+ list (APPEND _compileFlags "-arch" "${_arch}")
+ endforeach()
+ endif()
+ if (CMAKE_OSX_SYSROOT)
+ if (CMAKE_${_language}_SYSROOT_FLAG)
+ list (APPEND _compileFlags "${CMAKE_${_language}_SYSROOT_FLAG}" "${CMAKE_OSX_SYSROOT}")
+ else()
+ list (APPEND _compileFlags "-isysroot" "${CMAKE_OSX_SYSROOT}")
+ endif()
+ endif()
+ if (CMAKE_OSX_DEPLOYMENT_TARGET)
+ if (CMAKE_${_language}_OSX_DEPLOYMENT_TARGET_FLAG)
+ list (APPEND _compileFlags "${CMAKE_${_language}_OSX_DEPLOYMENT_TARGET_FLAG}${CMAKE_OSX_DEPLOYMENT_TARGET}")
+ else()
+ list (APPEND _compileFlags "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+ endif()
+ endif()
+ endif()
+ if (COTIRE_DEBUG AND _compileFlags)
+ message (STATUS "Target ${_target} compile flags: ${_compileFlags}")
+ endif()
+ set (${_flagsVar} ${_compileFlags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_include_directories _config _language _target _includeDirsVar _systemIncludeDirsVar)
+ set (_includeDirs "")
+ set (_systemIncludeDirs "")
+ # default include dirs
+ if (CMAKE_INCLUDE_CURRENT_DIR)
+ list (APPEND _includeDirs "${CMAKE_CURRENT_BINARY_DIR}")
+ list (APPEND _includeDirs "${CMAKE_CURRENT_SOURCE_DIR}")
+ endif()
+ set (_targetFlags "")
+ cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+ # parse additional include directories from target compile flags
+ if (CMAKE_INCLUDE_FLAG_${_language})
+ string (STRIP "${CMAKE_INCLUDE_FLAG_${_language}}" _includeFlag)
+ string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+ if (_includeFlag)
+ set (_dirs "")
+ cotire_filter_compile_flags("${_language}" "${_includeFlag}" _dirs _ignore ${_targetFlags})
+ if (_dirs)
+ list (APPEND _includeDirs ${_dirs})
+ endif()
+ endif()
+ endif()
+ # parse additional system include directories from target compile flags
+ if (CMAKE_INCLUDE_SYSTEM_FLAG_${_language})
+ string (STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _includeFlag)
+ string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+ if (_includeFlag)
+ set (_dirs "")
+ cotire_filter_compile_flags("${_language}" "${_includeFlag}" _dirs _ignore ${_targetFlags})
+ if (_dirs)
+ list (APPEND _systemIncludeDirs ${_dirs})
+ endif()
+ endif()
+ endif()
+ # target include directories
+ get_directory_property(_dirs DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" INCLUDE_DIRECTORIES)
+ if (_target)
+ get_target_property(_targetDirs ${_target} INCLUDE_DIRECTORIES)
+ if (_targetDirs)
+ list (APPEND _dirs ${_targetDirs})
+ endif()
+ get_target_property(_targetDirs ${_target} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
+ if (_targetDirs)
+ list (APPEND _systemIncludeDirs ${_targetDirs})
+ endif()
+ endif()
+ # interface include directories from linked library targets
+ if (_target)
+ set (_linkedTargets "")
+ cotire_get_target_usage_requirements(${_target} _linkedTargets)
+ foreach (_linkedTarget ${_linkedTargets})
+ get_target_property(_linkedTargetType ${_linkedTarget} TYPE)
+ if (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE AND NOT CMAKE_VERSION VERSION_LESS "3.4.0" AND
+ _linkedTargetType MATCHES "(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+ # CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE refers to CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR
+ # at the time, when the target was created. These correspond to the target properties BINARY_DIR and SOURCE_DIR
+ # which are only available with CMake 3.4 or later.
+ get_target_property(_targetDirs ${_linkedTarget} BINARY_DIR)
+ if (_targetDirs)
+ list (APPEND _dirs ${_targetDirs})
+ endif()
+ get_target_property(_targetDirs ${_linkedTarget} SOURCE_DIR)
+ if (_targetDirs)
+ list (APPEND _dirs ${_targetDirs})
+ endif()
+ endif()
+ get_target_property(_targetDirs ${_linkedTarget} INTERFACE_INCLUDE_DIRECTORIES)
+ if (_targetDirs)
+ list (APPEND _dirs ${_targetDirs})
+ endif()
+ get_target_property(_targetDirs ${_linkedTarget} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
+ if (_targetDirs)
+ list (APPEND _systemIncludeDirs ${_targetDirs})
+ endif()
+ endforeach()
+ endif()
+ if (dirs)
+ list (REMOVE_DUPLICATES _dirs)
+ endif()
+ list (LENGTH _includeDirs _projectInsertIndex)
+ foreach (_dir ${_dirs})
+ if (CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE)
+ cotire_check_is_path_relative_to("${_dir}" _isRelative "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}")
+ if (_isRelative)
+ list (LENGTH _includeDirs _len)
+ if (_len EQUAL _projectInsertIndex)
+ list (APPEND _includeDirs "${_dir}")
+ else()
+ list (INSERT _includeDirs _projectInsertIndex "${_dir}")
+ endif()
+ math (EXPR _projectInsertIndex "${_projectInsertIndex} + 1")
+ else()
+ list (APPEND _includeDirs "${_dir}")
+ endif()
+ else()
+ list (APPEND _includeDirs "${_dir}")
+ endif()
+ endforeach()
+ list (REMOVE_DUPLICATES _includeDirs)
+ list (REMOVE_DUPLICATES _systemIncludeDirs)
+ if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
+ list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
+ endif()
+ if (COTIRE_DEBUG AND _includeDirs)
+ message (STATUS "Target ${_target} include dirs: ${_includeDirs}")
+ endif()
+ set (${_includeDirsVar} ${_includeDirs} PARENT_SCOPE)
+ if (COTIRE_DEBUG AND _systemIncludeDirs)
+ message (STATUS "Target ${_target} system include dirs: ${_systemIncludeDirs}")
+ endif()
+ set (${_systemIncludeDirsVar} ${_systemIncludeDirs} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_export_symbol _target _exportSymbolVar)
+ set (_exportSymbol "")
+ get_target_property(_targetType ${_target} TYPE)
+ get_target_property(_enableExports ${_target} ENABLE_EXPORTS)
+ if (_targetType MATCHES "(SHARED|MODULE)_LIBRARY" OR
+ (_targetType STREQUAL "EXECUTABLE" AND _enableExports))
+ get_target_property(_exportSymbol ${_target} DEFINE_SYMBOL)
+ if (NOT _exportSymbol)
+ set (_exportSymbol "${_target}_EXPORTS")
+ endif()
+ string (MAKE_C_IDENTIFIER "${_exportSymbol}" _exportSymbol)
+ endif()
+ set (${_exportSymbolVar} ${_exportSymbol} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_compile_definitions _config _language _target _definitionsVar)
+ string (TOUPPER "${_config}" _upperConfig)
+ set (_configDefinitions "")
+ # CMAKE_INTDIR for multi-configuration build systems
+ if (NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
+ list (APPEND _configDefinitions "CMAKE_INTDIR=\"${_config}\"")
+ endif()
+ # target export define symbol
+ cotire_get_target_export_symbol("${_target}" _defineSymbol)
+ if (_defineSymbol)
+ list (APPEND _configDefinitions "${_defineSymbol}")
+ endif()
+ # directory compile definitions
+ get_directory_property(_definitions DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMPILE_DEFINITIONS)
+ if (_definitions)
+ list (APPEND _configDefinitions ${_definitions})
+ endif()
+ get_directory_property(_definitions DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMPILE_DEFINITIONS_${_upperConfig})
+ if (_definitions)
+ list (APPEND _configDefinitions ${_definitions})
+ endif()
+ # target compile definitions
+ get_target_property(_definitions ${_target} COMPILE_DEFINITIONS)
+ if (_definitions)
+ list (APPEND _configDefinitions ${_definitions})
+ endif()
+ get_target_property(_definitions ${_target} COMPILE_DEFINITIONS_${_upperConfig})
+ if (_definitions)
+ list (APPEND _configDefinitions ${_definitions})
+ endif()
+ # interface compile definitions from linked library targets
+ set (_linkedTargets "")
+ cotire_get_target_usage_requirements(${_target} _linkedTargets)
+ foreach (_linkedTarget ${_linkedTargets})
+ get_target_property(_definitions ${_linkedTarget} INTERFACE_COMPILE_DEFINITIONS)
+ if (_definitions)
+ list (APPEND _configDefinitions ${_definitions})
+ endif()
+ endforeach()
+ # parse additional compile definitions from target compile flags
+ # and don't look at directory compile definitions, which we already handled
+ set (_targetFlags "")
+ cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+ cotire_filter_compile_flags("${_language}" "D" _definitions _ignore ${_targetFlags})
+ if (_definitions)
+ list (APPEND _configDefinitions ${_definitions})
+ endif()
+ list (REMOVE_DUPLICATES _configDefinitions)
+ if (COTIRE_DEBUG AND _configDefinitions)
+ message (STATUS "Target ${_target} compile definitions: ${_configDefinitions}")
+ endif()
+ set (${_definitionsVar} ${_configDefinitions} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_compiler_flags _config _language _target _compilerFlagsVar)
+ # parse target compile flags omitting compile definitions and include directives
+ set (_targetFlags "")
+ cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+ set (_flagFilter "D")
+ if (CMAKE_INCLUDE_FLAG_${_language})
+ string (STRIP "${CMAKE_INCLUDE_FLAG_${_language}}" _includeFlag)
+ string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+ if (_includeFlag)
+ set (_flagFilter "${_flagFilter}|${_includeFlag}")
+ endif()
+ endif()
+ if (CMAKE_INCLUDE_SYSTEM_FLAG_${_language})
+ string (STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _includeFlag)
+ string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+ if (_includeFlag)
+ set (_flagFilter "${_flagFilter}|${_includeFlag}")
+ endif()
+ endif()
+ set (_compilerFlags "")
+ cotire_filter_compile_flags("${_language}" "${_flagFilter}" _ignore _compilerFlags ${_targetFlags})
+ if (COTIRE_DEBUG AND _compilerFlags)
+ message (STATUS "Target ${_target} compiler flags: ${_compilerFlags}")
+ endif()
+ set (${_compilerFlagsVar} ${_compilerFlags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_sys_root_paths _pathsVar)
+ if (APPLE)
+ if (CMAKE_OSX_SYSROOT AND CMAKE_${_language}_HAS_ISYSROOT)
+ foreach (_path IN LISTS ${_pathsVar})
+ if (IS_ABSOLUTE "${_path}")
+ get_filename_component(_path "${CMAKE_OSX_SYSROOT}/${_path}" ABSOLUTE)
+ if (EXISTS "${_path}")
+ list (APPEND ${_pathsVar} "${_path}")
+ endif()
+ endif()
+ endforeach()
+ endif()
+ endif()
+ set (${_pathsVar} ${${_pathsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_extra_properties _sourceFile _pattern _resultVar)
+ set (_extraProperties ${ARGN})
+ set (_result "")
+ if (_extraProperties)
+ list (FIND _extraProperties "${_sourceFile}" _index)
+ if (_index GREATER -1)
+ math (EXPR _index "${_index} + 1")
+ list (LENGTH _extraProperties _len)
+ math (EXPR _len "${_len} - 1")
+ foreach (_index RANGE ${_index} ${_len})
+ list (GET _extraProperties ${_index} _value)
+ if (_value MATCHES "${_pattern}")
+ list (APPEND _result "${_value}")
+ else()
+ break()
+ endif()
+ endforeach()
+ endif()
+ endif()
+ set (${_resultVar} ${_result} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_compile_definitions _config _language _sourceFile _definitionsVar)
+ set (_compileDefinitions "")
+ if (NOT CMAKE_SCRIPT_MODE_FILE)
+ string (TOUPPER "${_config}" _upperConfig)
+ get_source_file_property(_definitions "${_sourceFile}" COMPILE_DEFINITIONS)
+ if (_definitions)
+ list (APPEND _compileDefinitions ${_definitions})
+ endif()
+ get_source_file_property(_definitions "${_sourceFile}" COMPILE_DEFINITIONS_${_upperConfig})
+ if (_definitions)
+ list (APPEND _compileDefinitions ${_definitions})
+ endif()
+ endif()
+ cotire_get_source_extra_properties("${_sourceFile}" "^[a-zA-Z0-9_]+(=.*)?$" _definitions ${ARGN})
+ if (_definitions)
+ list (APPEND _compileDefinitions ${_definitions})
+ endif()
+ if (COTIRE_DEBUG AND _compileDefinitions)
+ message (STATUS "Source ${_sourceFile} compile definitions: ${_compileDefinitions}")
+ endif()
+ set (${_definitionsVar} ${_compileDefinitions} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_files_compile_definitions _config _language _definitionsVar)
+ set (_configDefinitions "")
+ foreach (_sourceFile ${ARGN})
+ cotire_get_source_compile_definitions("${_config}" "${_language}" "${_sourceFile}" _sourceDefinitions)
+ if (_sourceDefinitions)
+ list (APPEND _configDefinitions "${_sourceFile}" ${_sourceDefinitions} "-")
+ endif()
+ endforeach()
+ set (${_definitionsVar} ${_configDefinitions} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_undefs _sourceFile _property _sourceUndefsVar)
+ set (_sourceUndefs "")
+ if (NOT CMAKE_SCRIPT_MODE_FILE)
+ get_source_file_property(_undefs "${_sourceFile}" ${_property})
+ if (_undefs)
+ list (APPEND _sourceUndefs ${_undefs})
+ endif()
+ endif()
+ cotire_get_source_extra_properties("${_sourceFile}" "^[a-zA-Z0-9_]+$" _undefs ${ARGN})
+ if (_undefs)
+ list (APPEND _sourceUndefs ${_undefs})
+ endif()
+ if (COTIRE_DEBUG AND _sourceUndefs)
+ message (STATUS "Source ${_sourceFile} ${_property} undefs: ${_sourceUndefs}")
+ endif()
+ set (${_sourceUndefsVar} ${_sourceUndefs} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_files_undefs _property _sourceUndefsVar)
+ set (_sourceUndefs "")
+ foreach (_sourceFile ${ARGN})
+ cotire_get_source_undefs("${_sourceFile}" ${_property} _undefs)
+ if (_undefs)
+ list (APPEND _sourceUndefs "${_sourceFile}" ${_undefs} "-")
+ endif()
+ endforeach()
+ set (${_sourceUndefsVar} ${_sourceUndefs} PARENT_SCOPE)
+endfunction()
+
+macro (cotire_set_cmd_to_prologue _cmdVar)
+ set (${_cmdVar} "${CMAKE_COMMAND}")
+ if (COTIRE_DEBUG)
+ list (APPEND ${_cmdVar} "--warn-uninitialized")
+ endif()
+ list (APPEND ${_cmdVar} "-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>")
+ if (COTIRE_VERBOSE)
+ list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=ON")
+ elseif("${CMAKE_GENERATOR}" MATCHES "Makefiles")
+ list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=$(VERBOSE)")
+ endif()
+endmacro()
+
+function (cotire_init_compile_cmd _cmdVar _language _compilerLauncher _compilerExe _compilerArg1)
+ if (NOT _compilerLauncher)
+ set (_compilerLauncher ${CMAKE_${_language}_COMPILER_LAUNCHER})
+ endif()
+ if (NOT _compilerExe)
+ set (_compilerExe "${CMAKE_${_language}_COMPILER}")
+ endif()
+ if (NOT _compilerArg1)
+ set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
+ endif()
+ string (STRIP "${_compilerArg1}" _compilerArg1)
+ if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ # compiler launcher is only supported for Makefile and Ninja
+ set (${_cmdVar} ${_compilerLauncher} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+ else()
+ set (${_cmdVar} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+ endif()
+endfunction()
+
+macro (cotire_add_definitions_to_cmd _cmdVar _language)
+ foreach (_definition ${ARGN})
+ if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+ list (APPEND ${_cmdVar} "/D${_definition}")
+ else()
+ list (APPEND ${_cmdVar} "-D${_definition}")
+ endif()
+ endforeach()
+endmacro()
+
+function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
+ set (_includeDirs ${${_includesVar}} ${${_systemIncludesVar}})
+ if (_includeDirs)
+ list (REMOVE_DUPLICATES _includeDirs)
+ foreach (_include ${_includeDirs})
+ if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+ file (TO_NATIVE_PATH "${_include}" _include)
+ list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+ else()
+ set (_index -1)
+ if ("${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" MATCHES ".+")
+ list (FIND ${_systemIncludesVar} "${_include}" _index)
+ endif()
+ if (_index GREATER -1)
+ list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${_include}")
+ else()
+ list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+ endif()
+ endif()
+ endforeach()
+ endif()
+ set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_frameworks_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
+ if (APPLE)
+ set (_frameworkDirs "")
+ foreach (_include ${${_includesVar}})
+ if (IS_ABSOLUTE "${_include}" AND _include MATCHES "\\.framework$")
+ get_filename_component(_frameworkDir "${_include}" DIRECTORY)
+ list (APPEND _frameworkDirs "${_frameworkDir}")
+ endif()
+ endforeach()
+ set (_systemFrameworkDirs "")
+ foreach (_include ${${_systemIncludesVar}})
+ if (IS_ABSOLUTE "${_include}" AND _include MATCHES "\\.framework$")
+ get_filename_component(_frameworkDir "${_include}" DIRECTORY)
+ list (APPEND _systemFrameworkDirs "${_frameworkDir}")
+ endif()
+ endforeach()
+ if (_systemFrameworkDirs)
+ list (APPEND _frameworkDirs ${_systemFrameworkDirs})
+ endif()
+ if (_frameworkDirs)
+ list (REMOVE_DUPLICATES _frameworkDirs)
+ foreach (_frameworkDir ${_frameworkDirs})
+ set (_index -1)
+ if ("${CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG}" MATCHES ".+")
+ list (FIND _systemFrameworkDirs "${_frameworkDir}" _index)
+ endif()
+ if (_index GREATER -1)
+ list (APPEND ${_cmdVar} "${CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG}${_frameworkDir}")
+ else()
+ list (APPEND ${_cmdVar} "${CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG}${_frameworkDir}")
+ endif()
+ endforeach()
+ endif()
+ endif()
+ set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
+endfunction()
+
+macro (cotire_add_compile_flags_to_cmd _cmdVar)
+ foreach (_flag ${ARGN})
+ list (APPEND ${_cmdVar} "${_flag}")
+ endforeach()
+endmacro()
+
+function (cotire_check_file_up_to_date _fileIsUpToDateVar _file)
+ if (EXISTS "${_file}")
+ set (_triggerFile "")
+ foreach (_dependencyFile ${ARGN})
+ if (EXISTS "${_dependencyFile}")
+ # IS_NEWER_THAN returns TRUE if both files have the same timestamp
+ # thus we do the comparison in both directions to exclude ties
+ if ("${_dependencyFile}" IS_NEWER_THAN "${_file}" AND
+ NOT "${_file}" IS_NEWER_THAN "${_dependencyFile}")
+ set (_triggerFile "${_dependencyFile}")
+ break()
+ endif()
+ endif()
+ endforeach()
+ if (_triggerFile)
+ if (COTIRE_VERBOSE)
+ get_filename_component(_fileName "${_file}" NAME)
+ message (STATUS "${_fileName} update triggered by ${_triggerFile} change.")
+ endif()
+ set (${_fileIsUpToDateVar} FALSE PARENT_SCOPE)
+ else()
+ if (COTIRE_VERBOSE)
+ get_filename_component(_fileName "${_file}" NAME)
+ message (STATUS "${_fileName} is up-to-date.")
+ endif()
+ set (${_fileIsUpToDateVar} TRUE PARENT_SCOPE)
+ endif()
+ else()
+ if (COTIRE_VERBOSE)
+ get_filename_component(_fileName "${_file}" NAME)
+ message (STATUS "${_fileName} does not exist yet.")
+ endif()
+ set (${_fileIsUpToDateVar} FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
+macro (cotire_find_closest_relative_path _headerFile _includeDirs _relPathVar)
+ set (${_relPathVar} "")
+ foreach (_includeDir ${_includeDirs})
+ if (IS_DIRECTORY "${_includeDir}")
+ file (RELATIVE_PATH _relPath "${_includeDir}" "${_headerFile}")
+ if (NOT IS_ABSOLUTE "${_relPath}" AND NOT "${_relPath}" MATCHES "^\\.\\.")
+ string (LENGTH "${${_relPathVar}}" _closestLen)
+ string (LENGTH "${_relPath}" _relLen)
+ if (_closestLen EQUAL 0 OR _relLen LESS _closestLen)
+ set (${_relPathVar} "${_relPath}")
+ endif()
+ endif()
+ elseif ("${_includeDir}" STREQUAL "${_headerFile}")
+ # if path matches exactly, return short non-empty string
+ set (${_relPathVar} "1")
+ break()
+ endif()
+ endforeach()
+endmacro()
+
+macro (cotire_check_header_file_location _headerFile _insideIncludeDirs _outsideIncludeDirs _headerIsInside)
+ # check header path against ignored and honored include directories
+ cotire_find_closest_relative_path("${_headerFile}" "${_insideIncludeDirs}" _insideRelPath)
+ if (_insideRelPath)
+ # header is inside, but could be become outside if there is a shorter outside match
+ cotire_find_closest_relative_path("${_headerFile}" "${_outsideIncludeDirs}" _outsideRelPath)
+ if (_outsideRelPath)
+ string (LENGTH "${_insideRelPath}" _insideRelPathLen)
+ string (LENGTH "${_outsideRelPath}" _outsideRelPathLen)
+ if (_outsideRelPathLen LESS _insideRelPathLen)
+ set (${_headerIsInside} FALSE)
+ else()
+ set (${_headerIsInside} TRUE)
+ endif()
+ else()
+ set (${_headerIsInside} TRUE)
+ endif()
+ else()
+ # header is outside
+ set (${_headerIsInside} FALSE)
+ endif()
+endmacro()
+
+macro (cotire_check_ignore_header_file_path _headerFile _headerIsIgnoredVar)
+ if (NOT EXISTS "${_headerFile}")
+ set (${_headerIsIgnoredVar} TRUE)
+ elseif (IS_DIRECTORY "${_headerFile}")
+ set (${_headerIsIgnoredVar} TRUE)
+ elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed" AND "${_headerFile}" MATCHES "\\.h$")
+ # heuristic: ignore C headers with embedded parent directory references or "-fixed" or "_fixed" in path
+ # these often stem from using GCC #include_next tricks, which may break the precompiled header compilation
+ # with the error message "error: no include path in which to search for header.h"
+ set (${_headerIsIgnoredVar} TRUE)
+ else()
+ set (${_headerIsIgnoredVar} FALSE)
+ endif()
+endmacro()
+
+macro (cotire_check_ignore_header_file_ext _headerFile _ignoreExtensionsVar _headerIsIgnoredVar)
+ # check header file extension
+ cotire_get_source_file_extension("${_headerFile}" _headerFileExt)
+ set (${_headerIsIgnoredVar} FALSE)
+ if (_headerFileExt)
+ list (FIND ${_ignoreExtensionsVar} "${_headerFileExt}" _index)
+ if (_index GREATER -1)
+ set (${_headerIsIgnoredVar} TRUE)
+ endif()
+ endif()
+endmacro()
+
+macro (cotire_parse_line _line _headerFileVar _headerDepthVar)
+ if (MSVC)
+ # cl.exe /showIncludes output looks different depending on the language pack used, e.g.:
+ # English: "Note: including file: C:\directory\file"
+ # German: "Hinweis: Einlesen der Datei: C:\directory\file"
+ # We use a very general regular expression, relying on the presence of the : characters
+ if (_line MATCHES "( +)([a-zA-Z]:[^:]+)$")
+ # Visual Studio compiler output
+ string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
+ get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" ABSOLUTE)
+ else()
+ set (${_headerFileVar} "")
+ set (${_headerDepthVar} 0)
+ endif()
+ else()
+ if (_line MATCHES "^(\\.+) (.*)$")
+ # GCC like output
+ string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
+ if (IS_ABSOLUTE "${CMAKE_MATCH_2}")
+ set (${_headerFileVar} "${CMAKE_MATCH_2}")
+ else()
+ get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" REALPATH)
+ endif()
+ else()
+ set (${_headerFileVar} "")
+ set (${_headerDepthVar} 0)
+ endif()
+ endif()
+endmacro()
+
+function (cotire_parse_includes _language _scanOutput _ignoredIncludeDirs _honoredIncludeDirs _ignoredExtensions _selectedIncludesVar _unparsedLinesVar)
+ if (WIN32)
+ # prevent CMake macro invocation errors due to backslash characters in Windows paths
+ string (REPLACE "\\" "/" _scanOutput "${_scanOutput}")
+ endif()
+ # canonize slashes
+ string (REPLACE "//" "/" _scanOutput "${_scanOutput}")
+ # prevent semicolon from being interpreted as a line separator
+ string (REPLACE ";" "\\;" _scanOutput "${_scanOutput}")
+ # then separate lines
+ string (REGEX REPLACE "\n" ";" _scanOutput "${_scanOutput}")
+ list (LENGTH _scanOutput _len)
+ # remove duplicate lines to speed up parsing
+ list (REMOVE_DUPLICATES _scanOutput)
+ list (LENGTH _scanOutput _uniqueLen)
+ if (COTIRE_VERBOSE OR COTIRE_DEBUG)
+ message (STATUS "Scanning ${_uniqueLen} unique lines of ${_len} for includes")
+ if (_ignoredExtensions)
+ message (STATUS "Ignored extensions: ${_ignoredExtensions}")
+ endif()
+ if (_ignoredIncludeDirs)
+ message (STATUS "Ignored paths: ${_ignoredIncludeDirs}")
+ endif()
+ if (_honoredIncludeDirs)
+ message (STATUS "Included paths: ${_honoredIncludeDirs}")
+ endif()
+ endif()
+ set (_sourceFiles ${ARGN})
+ set (_selectedIncludes "")
+ set (_unparsedLines "")
+ # stack keeps track of inside/outside project status of processed header files
+ set (_headerIsInsideStack "")
+ foreach (_line IN LISTS _scanOutput)
+ if (_line)
+ cotire_parse_line("${_line}" _headerFile _headerDepth)
+ if (_headerFile)
+ cotire_check_header_file_location("${_headerFile}" "${_ignoredIncludeDirs}" "${_honoredIncludeDirs}" _headerIsInside)
+ if (COTIRE_DEBUG)
+ message (STATUS "${_headerDepth}: ${_headerFile} ${_headerIsInside}")
+ endif()
+ # update stack
+ list (LENGTH _headerIsInsideStack _stackLen)
+ if (_headerDepth GREATER _stackLen)
+ math (EXPR _stackLen "${_stackLen} + 1")
+ foreach (_index RANGE ${_stackLen} ${_headerDepth})
+ list (APPEND _headerIsInsideStack ${_headerIsInside})
+ endforeach()
+ else()
+ foreach (_index RANGE ${_headerDepth} ${_stackLen})
+ list (REMOVE_AT _headerIsInsideStack -1)
+ endforeach()
+ list (APPEND _headerIsInsideStack ${_headerIsInside})
+ endif()
+ if (COTIRE_DEBUG)
+ message (STATUS "${_headerIsInsideStack}")
+ endif()
+ # header is a candidate if it is outside project
+ if (NOT _headerIsInside)
+ # get parent header file's inside/outside status
+ if (_headerDepth GREATER 1)
+ math (EXPR _index "${_headerDepth} - 2")
+ list (GET _headerIsInsideStack ${_index} _parentHeaderIsInside)
+ else()
+ set (_parentHeaderIsInside TRUE)
+ endif()
+ # select header file if parent header file is inside project
+ # (e.g., a project header file that includes a standard header file)
+ if (_parentHeaderIsInside)
+ cotire_check_ignore_header_file_path("${_headerFile}" _headerIsIgnored)
+ if (NOT _headerIsIgnored)
+ cotire_check_ignore_header_file_ext("${_headerFile}" _ignoredExtensions _headerIsIgnored)
+ if (NOT _headerIsIgnored)
+ list (APPEND _selectedIncludes "${_headerFile}")
+ else()
+ # fix header's inside status on stack, it is ignored by extension now
+ list (REMOVE_AT _headerIsInsideStack -1)
+ list (APPEND _headerIsInsideStack TRUE)
+ endif()
+ endif()
+ if (COTIRE_DEBUG)
+ message (STATUS "${_headerFile} ${_ignoredExtensions} ${_headerIsIgnored}")
+ endif()
+ endif()
+ endif()
+ else()
+ if (MSVC)
+ # for cl.exe do not keep unparsed lines which solely consist of a source file name
+ string (FIND "${_sourceFiles}" "${_line}" _index)
+ if (_index LESS 0)
+ list (APPEND _unparsedLines "${_line}")
+ endif()
+ else()
+ list (APPEND _unparsedLines "${_line}")
+ endif()
+ endif()
+ endif()
+ endforeach()
+ list (REMOVE_DUPLICATES _selectedIncludes)
+ set (${_selectedIncludesVar} ${_selectedIncludes} PARENT_SCOPE)
+ set (${_unparsedLinesVar} ${_unparsedLines} PARENT_SCOPE)
+endfunction()
+
+function (cotire_scan_includes _includesVar)
+ set(_options "")
+ set(_oneValueArgs COMPILER_ID COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_VERSION LANGUAGE UNPARSED_LINES)
+ set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES
+ IGNORE_PATH INCLUDE_PATH IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH COMPILER_LAUNCHER)
+ cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+ set (_sourceFiles ${_option_UNPARSED_ARGUMENTS})
+ if (NOT _option_LANGUAGE)
+ set (_option_LANGUAGE "CXX")
+ endif()
+ if (NOT _option_COMPILER_ID)
+ set (_option_COMPILER_ID "${CMAKE_${_option_LANGUAGE}_ID}")
+ endif()
+ if (NOT _option_COMPILER_VERSION)
+ set (_option_COMPILER_VERSION "${CMAKE_${_option_LANGUAGE}_COMPILER_VERSION}")
+ endif()
+ cotire_init_compile_cmd(_cmd "${_option_LANGUAGE}" "${_option_COMPILER_LAUNCHER}" "${_option_COMPILER_EXECUTABLE}" "${_option_COMPILER_ARG1}")
+ cotire_add_definitions_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_COMPILE_DEFINITIONS})
+ cotire_add_compile_flags_to_cmd(_cmd ${_option_COMPILE_FLAGS})
+ cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+ cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+ cotire_add_makedep_flags("${_option_LANGUAGE}" "${_option_COMPILER_ID}" "${_option_COMPILER_VERSION}" _cmd)
+ # only consider existing source files for scanning
+ set (_existingSourceFiles "")
+ foreach (_sourceFile ${_sourceFiles})
+ if (EXISTS "${_sourceFile}")
+ list (APPEND _existingSourceFiles "${_sourceFile}")
+ endif()
+ endforeach()
+ if (NOT _existingSourceFiles)
+ set (${_includesVar} "" PARENT_SCOPE)
+ return()
+ endif()
+ list (APPEND _cmd ${_existingSourceFiles})
+ if (COTIRE_VERBOSE)
+ message (STATUS "execute_process: ${_cmd}")
+ endif()
+ if (_option_COMPILER_ID MATCHES "MSVC")
+ # cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
+ unset (ENV{VS_UNICODE_OUTPUT})
+ endif()
+ execute_process(
+ COMMAND ${_cmd}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ RESULT_VARIABLE _result
+ OUTPUT_QUIET
+ ERROR_VARIABLE _output)
+ if (_result)
+ message (STATUS "Result ${_result} scanning includes of ${_existingSourceFiles}.")
+ endif()
+ cotire_parse_includes(
+ "${_option_LANGUAGE}" "${_output}"
+ "${_option_IGNORE_PATH}" "${_option_INCLUDE_PATH}"
+ "${_option_IGNORE_EXTENSIONS}"
+ _includes _unparsedLines
+ ${_sourceFiles})
+ if (_option_INCLUDE_PRIORITY_PATH)
+ set (_sortedIncludes "")
+ foreach (_priorityPath ${_option_INCLUDE_PRIORITY_PATH})
+ foreach (_include ${_includes})
+ string (FIND ${_include} ${_priorityPath} _position)
+ if (_position GREATER -1)
+ list (APPEND _sortedIncludes ${_include})
+ endif()
+ endforeach()
+ endforeach()
+ if (_sortedIncludes)
+ list (INSERT _includes 0 ${_sortedIncludes})
+ list (REMOVE_DUPLICATES _includes)
+ endif()
+ endif()
+ set (${_includesVar} ${_includes} PARENT_SCOPE)
+ if (_option_UNPARSED_LINES)
+ set (${_option_UNPARSED_LINES} ${_unparsedLines} PARENT_SCOPE)
+ endif()
+endfunction()
+
+macro (cotire_append_undefs _contentsVar)
+ set (_undefs ${ARGN})
+ if (_undefs)
+ list (REMOVE_DUPLICATES _undefs)
+ foreach (_definition ${_undefs})
+ list (APPEND ${_contentsVar} "#undef ${_definition}")
+ endforeach()
+ endif()
+endmacro()
+
+macro (cotire_comment_str _language _commentText _commentVar)
+ if ("${_language}" STREQUAL "CMAKE")
+ set (${_commentVar} "# ${_commentText}")
+ else()
+ set (${_commentVar} "/* ${_commentText} */")
+ endif()
+endmacro()
+
+function (cotire_write_file _language _file _contents _force)
+ get_filename_component(_moduleName "${COTIRE_CMAKE_MODULE_FILE}" NAME)
+ cotire_comment_str("${_language}" "${_moduleName} ${COTIRE_CMAKE_MODULE_VERSION} generated file" _header1)
+ cotire_comment_str("${_language}" "${_file}" _header2)
+ set (_contents "${_header1}\n${_header2}\n${_contents}")
+ if (COTIRE_DEBUG)
+ message (STATUS "${_contents}")
+ endif()
+ if (_force OR NOT EXISTS "${_file}")
+ file (WRITE "${_file}" "${_contents}")
+ else()
+ file (READ "${_file}" _oldContents)
+ if (NOT "${_oldContents}" STREQUAL "${_contents}")
+ file (WRITE "${_file}" "${_contents}")
+ else()
+ if (COTIRE_DEBUG)
+ message (STATUS "${_file} unchanged")
+ endif()
+ endif()
+ endif()
+endfunction()
+
+function (cotire_generate_unity_source _unityFile)
+ set(_options "")
+ set(_oneValueArgs LANGUAGE)
+ set(_multiValueArgs
+ DEPENDS SOURCES_COMPILE_DEFINITIONS
+ PRE_UNDEFS SOURCES_PRE_UNDEFS POST_UNDEFS SOURCES_POST_UNDEFS PROLOGUE EPILOGUE)
+ cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+ if (_option_DEPENDS)
+ cotire_check_file_up_to_date(_unityFileIsUpToDate "${_unityFile}" ${_option_DEPENDS})
+ if (_unityFileIsUpToDate)
+ return()
+ endif()
+ endif()
+ set (_sourceFiles ${_option_UNPARSED_ARGUMENTS})
+ if (NOT _option_PRE_UNDEFS)
+ set (_option_PRE_UNDEFS "")
+ endif()
+ if (NOT _option_SOURCES_PRE_UNDEFS)
+ set (_option_SOURCES_PRE_UNDEFS "")
+ endif()
+ if (NOT _option_POST_UNDEFS)
+ set (_option_POST_UNDEFS "")
+ endif()
+ if (NOT _option_SOURCES_POST_UNDEFS)
+ set (_option_SOURCES_POST_UNDEFS "")
+ endif()
+ set (_contents "")
+ if (_option_PROLOGUE)
+ list (APPEND _contents ${_option_PROLOGUE})
+ endif()
+ if (_option_LANGUAGE AND _sourceFiles)
+ if ("${_option_LANGUAGE}" STREQUAL "CXX")
+ list (APPEND _contents "#ifdef __cplusplus")
+ elseif ("${_option_LANGUAGE}" STREQUAL "C")
+ list (APPEND _contents "#ifndef __cplusplus")
+ endif()
+ endif()
+ set (_compileUndefinitions "")
+ foreach (_sourceFile ${_sourceFiles})
+ cotire_get_source_compile_definitions(
+ "${_option_CONFIGURATION}" "${_option_LANGUAGE}" "${_sourceFile}" _compileDefinitions
+ ${_option_SOURCES_COMPILE_DEFINITIONS})
+ cotire_get_source_undefs("${_sourceFile}" COTIRE_UNITY_SOURCE_PRE_UNDEFS _sourcePreUndefs ${_option_SOURCES_PRE_UNDEFS})
+ cotire_get_source_undefs("${_sourceFile}" COTIRE_UNITY_SOURCE_POST_UNDEFS _sourcePostUndefs ${_option_SOURCES_POST_UNDEFS})
+ if (_option_PRE_UNDEFS)
+ list (APPEND _compileUndefinitions ${_option_PRE_UNDEFS})
+ endif()
+ if (_sourcePreUndefs)
+ list (APPEND _compileUndefinitions ${_sourcePreUndefs})
+ endif()
+ if (_compileUndefinitions)
+ cotire_append_undefs(_contents ${_compileUndefinitions})
+ set (_compileUndefinitions "")
+ endif()
+ if (_sourcePostUndefs)
+ list (APPEND _compileUndefinitions ${_sourcePostUndefs})
+ endif()
+ if (_option_POST_UNDEFS)
+ list (APPEND _compileUndefinitions ${_option_POST_UNDEFS})
+ endif()
+ foreach (_definition ${_compileDefinitions})
+ if (_definition MATCHES "^([a-zA-Z0-9_]+)=(.+)$")
+ list (APPEND _contents "#define ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}")
+ list (INSERT _compileUndefinitions 0 "${CMAKE_MATCH_1}")
+ else()
+ list (APPEND _contents "#define ${_definition}")
+ list (INSERT _compileUndefinitions 0 "${_definition}")
+ endif()
+ endforeach()
+ # use absolute path as source file location
+ get_filename_component(_sourceFileLocation "${_sourceFile}" ABSOLUTE)
+ if (WIN32)
+ file (TO_NATIVE_PATH "${_sourceFileLocation}" _sourceFileLocation)
+ endif()
+ list (APPEND _contents "#include \"${_sourceFileLocation}\"")
+ endforeach()
+ if (_compileUndefinitions)
+ cotire_append_undefs(_contents ${_compileUndefinitions})
+ set (_compileUndefinitions "")
+ endif()
+ if (_option_LANGUAGE AND _sourceFiles)
+ list (APPEND _contents "#endif")
+ endif()
+ if (_option_EPILOGUE)
+ list (APPEND _contents ${_option_EPILOGUE})
+ endif()
+ list (APPEND _contents "")
+ string (REPLACE ";" "\n" _contents "${_contents}")
+ if (COTIRE_VERBOSE)
+ message ("${_contents}")
+ endif()
+ cotire_write_file("${_option_LANGUAGE}" "${_unityFile}" "${_contents}" TRUE)
+endfunction()
+
+function (cotire_generate_prefix_header _prefixFile)
+ set(_options "")
+ set(_oneValueArgs LANGUAGE COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_ID COMPILER_VERSION)
+ set(_multiValueArgs DEPENDS COMPILE_DEFINITIONS COMPILE_FLAGS
+ INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES IGNORE_PATH INCLUDE_PATH
+ IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH COMPILER_LAUNCHER)
+ cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+ if (NOT _option_COMPILER_ID)
+ set (_option_COMPILER_ID "${CMAKE_${_option_LANGUAGE}_ID}")
+ endif()
+ if (NOT _option_COMPILER_VERSION)
+ set (_option_COMPILER_VERSION "${CMAKE_${_option_LANGUAGE}_COMPILER_VERSION}")
+ endif()
+ if (_option_DEPENDS)
+ cotire_check_file_up_to_date(_prefixFileIsUpToDate "${_prefixFile}" ${_option_DEPENDS})
+ if (_prefixFileIsUpToDate)
+ # create empty log file
+ set (_unparsedLinesFile "${_prefixFile}.log")
+ file (WRITE "${_unparsedLinesFile}" "")
+ return()
+ endif()
+ endif()
+ set (_prologue "")
+ set (_epilogue "")
+ if (_option_COMPILER_ID MATCHES "Clang")
+ set (_prologue "#pragma clang system_header")
+ elseif (_option_COMPILER_ID MATCHES "GNU")
+ set (_prologue "#pragma GCC system_header")
+ elseif (_option_COMPILER_ID MATCHES "MSVC")
+ set (_prologue "#pragma warning(push, 0)")
+ set (_epilogue "#pragma warning(pop)")
+ elseif (_option_COMPILER_ID MATCHES "Intel")
+ # Intel compiler requires hdrstop pragma to stop generating PCH file
+ set (_epilogue "#pragma hdrstop")
+ endif()
+ set (_sourceFiles ${_option_UNPARSED_ARGUMENTS})
+ cotire_scan_includes(_selectedHeaders ${_sourceFiles}
+ LANGUAGE "${_option_LANGUAGE}"
+ COMPILER_LAUNCHER "${_option_COMPILER_LAUNCHER}"
+ COMPILER_EXECUTABLE "${_option_COMPILER_EXECUTABLE}"
+ COMPILER_ARG1 "${_option_COMPILER_ARG1}"
+ COMPILER_ID "${_option_COMPILER_ID}"
+ COMPILER_VERSION "${_option_COMPILER_VERSION}"
+ COMPILE_DEFINITIONS ${_option_COMPILE_DEFINITIONS}
+ COMPILE_FLAGS ${_option_COMPILE_FLAGS}
+ INCLUDE_DIRECTORIES ${_option_INCLUDE_DIRECTORIES}
+ SYSTEM_INCLUDE_DIRECTORIES ${_option_SYSTEM_INCLUDE_DIRECTORIES}
+ IGNORE_PATH ${_option_IGNORE_PATH}
+ INCLUDE_PATH ${_option_INCLUDE_PATH}
+ IGNORE_EXTENSIONS ${_option_IGNORE_EXTENSIONS}
+ INCLUDE_PRIORITY_PATH ${_option_INCLUDE_PRIORITY_PATH}
+ UNPARSED_LINES _unparsedLines)
+ cotire_generate_unity_source("${_prefixFile}"
+ PROLOGUE ${_prologue} EPILOGUE ${_epilogue} LANGUAGE "${_option_LANGUAGE}" ${_selectedHeaders})
+ set (_unparsedLinesFile "${_prefixFile}.log")
+ if (_unparsedLines)
+ if (COTIRE_VERBOSE OR NOT _selectedHeaders)
+ list (LENGTH _unparsedLines _skippedLineCount)
+ message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesFile}")
+ endif()
+ string (REPLACE ";" "\n" _unparsedLines "${_unparsedLines}")
+ endif()
+ file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}")
+endfunction()
+
+function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flagsVar)
+ set (_flags ${${_flagsVar}})
+ if (_compilerID MATCHES "MSVC")
+ # cl.exe options used
+ # /nologo suppresses display of sign-on banner
+ # /TC treat all files named on the command line as C source files
+ # /TP treat all files named on the command line as C++ source files
+ # /EP preprocess to stdout without #line directives
+ # /showIncludes list include files
+ set (_sourceFileTypeC "/TC")
+ set (_sourceFileTypeCXX "/TP")
+ if (_flags)
+ # append to list
+ list (APPEND _flags /nologo "${_sourceFileType${_language}}" /EP /showIncludes)
+ else()
+ # return as a flag string
+ set (_flags "${_sourceFileType${_language}} /EP /showIncludes")
+ endif()
+ elseif (_compilerID MATCHES "GNU")
+ # GCC options used
+ # -H print the name of each header file used
+ # -E invoke preprocessor
+ # -fdirectives-only do not expand macros, requires GCC >= 4.3
+ if (_flags)
+ # append to list
+ list (APPEND _flags -H -E)
+ if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
+ list (APPEND _flags "-fdirectives-only")
+ endif()
+ else()
+ # return as a flag string
+ set (_flags "-H -E")
+ if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
+ set (_flags "${_flags} -fdirectives-only")
+ endif()
+ endif()
+ elseif (_compilerID MATCHES "Clang")
+ # Clang options used
+ # -H print the name of each header file used
+ # -E invoke preprocessor
+ # -fno-color-diagnostics don't prints diagnostics in color
+ if (_flags)
+ # append to list
+ list (APPEND _flags -H -E -fno-color-diagnostics)
+ else()
+ # return as a flag string
+ set (_flags "-H -E -fno-color-diagnostics")
+ endif()
+ elseif (_compilerID MATCHES "Intel")
+ if (WIN32)
+ # Windows Intel options used
+ # /nologo do not display compiler version information
+ # /QH display the include file order
+ # /EP preprocess to stdout, omitting #line directives
+ # /TC process all source or unrecognized file types as C source files
+ # /TP process all source or unrecognized file types as C++ source files
+ set (_sourceFileTypeC "/TC")
+ set (_sourceFileTypeCXX "/TP")
+ if (_flags)
+ # append to list
+ list (APPEND _flags /nologo "${_sourceFileType${_language}}" /EP /QH)
+ else()
+ # return as a flag string
+ set (_flags "${_sourceFileType${_language}} /EP /QH")
+ endif()
+ else()
+ # Linux / Mac OS X Intel options used
+ # -H print the name of each header file used
+ # -EP preprocess to stdout, omitting #line directives
+ # -Kc++ process all source or unrecognized file types as C++ source files
+ if (_flags)
+ # append to list
+ if ("${_language}" STREQUAL "CXX")
+ list (APPEND _flags -Kc++)
+ endif()
+ list (APPEND _flags -H -EP)
+ else()
+ # return as a flag string
+ if ("${_language}" STREQUAL "CXX")
+ set (_flags "-Kc++ ")
+ endif()
+ set (_flags "${_flags}-H -EP")
+ endif()
+ endif()
+ else()
+ message (FATAL_ERROR "cotire: unsupported ${_language} compiler ${_compilerID} version ${_compilerVersion}.")
+ endif()
+ set (${_flagsVar} ${_flags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersion _prefixFile _pchFile _hostFile _flagsVar)
+ set (_flags ${${_flagsVar}})
+ if (_compilerID MATCHES "MSVC")
+ file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+ file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+ file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
+ # cl.exe options used
+ # /Yc creates a precompiled header file
+ # /Fp specifies precompiled header binary file name
+ # /FI forces inclusion of file
+ # /TC treat all files named on the command line as C source files
+ # /TP treat all files named on the command line as C++ source files
+ # /Zs syntax check only
+ # /Zm precompiled header memory allocation scaling factor
+ set (_sourceFileTypeC "/TC")
+ set (_sourceFileTypeCXX "/TP")
+ if (_flags)
+ # append to list
+ list (APPEND _flags /nologo "${_sourceFileType${_language}}"
+ "/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
+ if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
+ list (APPEND _flags "/Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
+ endif()
+ else()
+ # return as a flag string
+ set (_flags "/Yc\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+ if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
+ set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
+ endif()
+ endif()
+ elseif (_compilerID MATCHES "GNU|Clang")
+ # GCC / Clang options used
+ # -x specify the source language
+ # -c compile but do not link
+ # -o place output in file
+ # note that we cannot use -w to suppress all warnings upon pre-compiling, because turning off a warning may
+ # alter compile flags as a side effect (e.g., -Wwrite-string implies -fconst-strings)
+ set (_xLanguage_C "c-header")
+ set (_xLanguage_CXX "c++-header")
+ if (_flags)
+ # append to list
+ list (APPEND _flags "-x" "${_xLanguage_${_language}}" "-c" "${_prefixFile}" -o "${_pchFile}")
+ else()
+ # return as a flag string
+ set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+ endif()
+ elseif (_compilerID MATCHES "Intel")
+ if (WIN32)
+ file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+ file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+ file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
+ # Windows Intel options used
+ # /nologo do not display compiler version information
+ # /Yc create a precompiled header (PCH) file
+ # /Fp specify a path or file name for precompiled header files
+ # /FI tells the preprocessor to include a specified file name as the header file
+ # /TC process all source or unrecognized file types as C source files
+ # /TP process all source or unrecognized file types as C++ source files
+ # /Zs syntax check only
+ # /Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
+ set (_sourceFileTypeC "/TC")
+ set (_sourceFileTypeCXX "/TP")
+ if (_flags)
+ # append to list
+ list (APPEND _flags /nologo "${_sourceFileType${_language}}"
+ "/Yc" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
+ if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+ list (APPEND _flags "/Wpch-messages")
+ endif()
+ else()
+ # return as a flag string
+ set (_flags "/Yc /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+ if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+ set (_flags "${_flags} /Wpch-messages")
+ endif()
+ endif()
+ else()
+ # Linux / Mac OS X Intel options used
+ # -pch-dir location for precompiled header files
+ # -pch-create name of the precompiled header (PCH) to create
+ # -Kc++ process all source or unrecognized file types as C++ source files
+ # -fsyntax-only check only for correct syntax
+ # -Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
+ get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
+ get_filename_component(_pchName "${_pchFile}" NAME)
+ set (_xLanguage_C "c-header")
+ set (_xLanguage_CXX "c++-header")
+ if (_flags)
+ # append to list
+ if ("${_language}" STREQUAL "CXX")
+ list (APPEND _flags -Kc++)
+ endif()
+ list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}")
+ if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+ list (APPEND _flags "-Wpch-messages")
+ endif()
+ else()
+ # return as a flag string
+ set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"")
+ if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+ set (_flags "${_flags} -Wpch-messages")
+ endif()
+ endif()
+ endif()
+ else()
+ message (FATAL_ERROR "cotire: unsupported ${_language} compiler ${_compilerID} version ${_compilerVersion}.")
+ endif()
+ set (${_flagsVar} ${_flags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerVersion _prefixFile _pchFile _flagsVar)
+ set (_flags ${${_flagsVar}})
+ if (_compilerID MATCHES "MSVC")
+ file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+ # cl.exe options used
+ # /Yu uses a precompiled header file during build
+ # /Fp specifies precompiled header binary file name
+ # /FI forces inclusion of file
+ # /Zm precompiled header memory allocation scaling factor
+ if (_pchFile)
+ file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+ if (_flags)
+ # append to list
+ list (APPEND _flags "/Yu${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
+ if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
+ list (APPEND _flags "/Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
+ endif()
+ else()
+ # return as a flag string
+ set (_flags "/Yu\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+ if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
+ set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
+ endif()
+ endif()
+ else()
+ # no precompiled header, force inclusion of prefix header
+ if (_flags)
+ # append to list
+ list (APPEND _flags "/FI${_prefixFileNative}")
+ else()
+ # return as a flag string
+ set (_flags "/FI\"${_prefixFileNative}\"")
+ endif()
+ endif()
+ elseif (_compilerID MATCHES "GNU")
+ # GCC options used
+ # -include process include file as the first line of the primary source file
+ # -Winvalid-pch warns if precompiled header is found but cannot be used
+ # note: ccache requires the -include flag to be used in order to process precompiled header correctly
+ if (_flags)
+ # append to list
+ list (APPEND _flags "-Winvalid-pch" "-include" "${_prefixFile}")
+ else()
+ # return as a flag string
+ set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
+ endif()
+ elseif (_compilerID MATCHES "Clang")
+ # Clang options used
+ # -include process include file as the first line of the primary source file
+ # -include-pch include precompiled header file
+ # -Qunused-arguments don't emit warning for unused driver arguments
+ # note: ccache requires the -include flag to be used in order to process precompiled header correctly
+ if (_flags)
+ # append to list
+ list (APPEND _flags "-Qunused-arguments" "-include" "${_prefixFile}")
+ else()
+ # return as a flag string
+ set (_flags "-Qunused-arguments -include \"${_prefixFile}\"")
+ endif()
+ elseif (_compilerID MATCHES "Intel")
+ if (WIN32)
+ file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+ # Windows Intel options used
+ # /Yu use a precompiled header (PCH) file
+ # /Fp specify a path or file name for precompiled header files
+ # /FI tells the preprocessor to include a specified file name as the header file
+ # /Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
+ if (_pchFile)
+ file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+ if (_flags)
+ # append to list
+ list (APPEND _flags "/Yu" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
+ if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+ list (APPEND _flags "/Wpch-messages")
+ endif()
+ else()
+ # return as a flag string
+ set (_flags "/Yu /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+ if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+ set (_flags "${_flags} /Wpch-messages")
+ endif()
+ endif()
+ else()
+ # no precompiled header, force inclusion of prefix header
+ if (_flags)
+ # append to list
+ list (APPEND _flags "/FI${_prefixFileNative}")
+ else()
+ # return as a flag string
+ set (_flags "/FI\"${_prefixFileNative}\"")
+ endif()
+ endif()
+ else()
+ # Linux / Mac OS X Intel options used
+ # -pch-dir location for precompiled header files
+ # -pch-use name of the precompiled header (PCH) to use
+ # -include process include file as the first line of the primary source file
+ # -Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
+ if (_pchFile)
+ get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
+ get_filename_component(_pchName "${_pchFile}" NAME)
+ if (_flags)
+ # append to list
+ list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}")
+ if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+ list (APPEND _flags "-Wpch-messages")
+ endif()
+ else()
+ # return as a flag string
+ set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"")
+ if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+ set (_flags "${_flags} -Wpch-messages")
+ endif()
+ endif()
+ else()
+ # no precompiled header, force inclusion of prefix header
+ if (_flags)
+ # append to list
+ list (APPEND _flags "-include" "${_prefixFile}")
+ else()
+ # return as a flag string
+ set (_flags "-include \"${_prefixFile}\"")
+ endif()
+ endif()
+ endif()
+ else()
+ message (FATAL_ERROR "cotire: unsupported ${_language} compiler ${_compilerID} version ${_compilerVersion}.")
+ endif()
+ set (${_flagsVar} ${_flags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_precompile_prefix_header _prefixFile _pchFile _hostFile)
+ set(_options "")
+ set(_oneValueArgs COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_ID COMPILER_VERSION LANGUAGE)
+ set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES SYS COMPILER_LAUNCHER)
+ cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+ if (NOT _option_LANGUAGE)
+ set (_option_LANGUAGE "CXX")
+ endif()
+ if (NOT _option_COMPILER_ID)
+ set (_option_COMPILER_ID "${CMAKE_${_option_LANGUAGE}_ID}")
+ endif()
+ if (NOT _option_COMPILER_VERSION)
+ set (_option_COMPILER_VERSION "${CMAKE_${_option_LANGUAGE}_COMPILER_VERSION}")
+ endif()
+ cotire_init_compile_cmd(_cmd "${_option_LANGUAGE}" "${_option_COMPILER_LAUNCHER}" "${_option_COMPILER_EXECUTABLE}" "${_option_COMPILER_ARG1}")
+ cotire_add_definitions_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_COMPILE_DEFINITIONS})
+ cotire_add_compile_flags_to_cmd(_cmd ${_option_COMPILE_FLAGS})
+ cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+ cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+ cotire_add_pch_compilation_flags(
+ "${_option_LANGUAGE}" "${_option_COMPILER_ID}" "${_option_COMPILER_VERSION}"
+ "${_prefixFile}" "${_pchFile}" "${_hostFile}" _cmd)
+ if (COTIRE_VERBOSE)
+ message (STATUS "execute_process: ${_cmd}")
+ endif()
+ if (_option_COMPILER_ID MATCHES "MSVC")
+ # cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
+ unset (ENV{VS_UNICODE_OUTPUT})
+ endif()
+ execute_process(
+ COMMAND ${_cmd}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ RESULT_VARIABLE _result)
+ if (_result)
+ message (FATAL_ERROR "cotire: error ${_result} precompiling ${_prefixFile}.")
+ endif()
+endfunction()
+
+function (cotire_check_precompiled_header_support _language _target _msgVar)
+ set (_unsupportedCompiler
+ "Precompiled headers not supported for ${_language} compiler ${CMAKE_${_language}_COMPILER_ID}")
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
+ # supported since Visual Studio C++ 6.0
+ # and CMake does not support an earlier version
+ set (${_msgVar} "" PARENT_SCOPE)
+ elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
+ # GCC PCH support requires version >= 3.4
+ if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "3.4.0")
+ set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}." PARENT_SCOPE)
+ else()
+ set (${_msgVar} "" PARENT_SCOPE)
+ endif()
+ elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
+ # all Clang versions have PCH support
+ set (${_msgVar} "" PARENT_SCOPE)
+ elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
+ # Intel PCH support requires version >= 8.0.0
+ if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
+ set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}." PARENT_SCOPE)
+ else()
+ set (${_msgVar} "" PARENT_SCOPE)
+ endif()
+ else()
+ set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
+ endif()
+ get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
+ if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
+ if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros|pch_defines")
+ set (${_msgVar}
+ "ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
+ PARENT_SCOPE)
+ endif()
+ endif()
+ if (APPLE)
+ # PCH compilation not supported by GCC / Clang for multi-architecture builds (e.g., i386, x86_64)
+ cotire_get_configuration_types(_configs)
+ foreach (_config ${_configs})
+ set (_targetFlags "")
+ cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+ cotire_filter_compile_flags("${_language}" "arch" _architectures _ignore ${_targetFlags})
+ list (LENGTH _architectures _numberOfArchitectures)
+ if (_numberOfArchitectures GREATER 1)
+ string (REPLACE ";" ", " _architectureStr "${_architectures}")
+ set (${_msgVar}
+ "Precompiled headers not supported on Darwin for multi-architecture builds (${_architectureStr})."
+ PARENT_SCOPE)
+ break()
+ endif()
+ endforeach()
+ endif()
+endfunction()
+
+macro (cotire_get_intermediate_dir _cotireDir)
+ # ${CMAKE_CFG_INTDIR} may reference a build-time variable when using a generator which supports configuration types
+ get_filename_component(${_cotireDir} "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${COTIRE_INTDIR}" ABSOLUTE)
+endmacro()
+
+macro (cotire_setup_file_extension_variables)
+ set (_unityFileExt_C ".c")
+ set (_unityFileExt_CXX ".cxx")
+ set (_prefixFileExt_C ".h")
+ set (_prefixFileExt_CXX ".hxx")
+ set (_prefixSourceFileExt_C ".c")
+ set (_prefixSourceFileExt_CXX ".cxx")
+endmacro()
+
+function (cotire_make_single_unity_source_file_path _language _target _unityFileVar)
+ cotire_setup_file_extension_variables()
+ if (NOT DEFINED _unityFileExt_${_language})
+ set (${_unityFileVar} "" PARENT_SCOPE)
+ return()
+ endif()
+ set (_unityFileBaseName "${_target}_${_language}${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}")
+ set (_unityFileName "${_unityFileBaseName}${_unityFileExt_${_language}}")
+ cotire_get_intermediate_dir(_baseDir)
+ set (_unityFile "${_baseDir}/${_unityFileName}")
+ set (${_unityFileVar} "${_unityFile}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_make_unity_source_file_paths _language _target _maxIncludes _unityFilesVar)
+ cotire_setup_file_extension_variables()
+ if (NOT DEFINED _unityFileExt_${_language})
+ set (${_unityFileVar} "" PARENT_SCOPE)
+ return()
+ endif()
+ set (_unityFileBaseName "${_target}_${_language}${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}")
+ cotire_get_intermediate_dir(_baseDir)
+ set (_startIndex 0)
+ set (_index 0)
+ set (_unityFiles "")
+ set (_sourceFiles ${ARGN})
+ foreach (_sourceFile ${_sourceFiles})
+ get_source_file_property(_startNew "${_sourceFile}" COTIRE_START_NEW_UNITY_SOURCE)
+ math (EXPR _unityFileCount "${_index} - ${_startIndex}")
+ if (_startNew OR (_maxIncludes GREATER 0 AND NOT _unityFileCount LESS _maxIncludes))
+ if (_index GREATER 0)
+ # start new unity file segment
+ math (EXPR _endIndex "${_index} - 1")
+ set (_unityFileName "${_unityFileBaseName}_${_startIndex}_${_endIndex}${_unityFileExt_${_language}}")
+ list (APPEND _unityFiles "${_baseDir}/${_unityFileName}")
+ endif()
+ set (_startIndex ${_index})
+ endif()
+ math (EXPR _index "${_index} + 1")
+ endforeach()
+ list (LENGTH _sourceFiles _numberOfSources)
+ if (_startIndex EQUAL 0)
+ # there is only a single unity file
+ cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFiles)
+ elseif (_startIndex LESS _numberOfSources)
+ # end with final unity file segment
+ math (EXPR _endIndex "${_index} - 1")
+ set (_unityFileName "${_unityFileBaseName}_${_startIndex}_${_endIndex}${_unityFileExt_${_language}}")
+ list (APPEND _unityFiles "${_baseDir}/${_unityFileName}")
+ endif()
+ set (${_unityFilesVar} ${_unityFiles} PARENT_SCOPE)
+ if (COTIRE_DEBUG AND _unityFiles)
+ message (STATUS "unity files: ${_unityFiles}")
+ endif()
+endfunction()
+
+function (cotire_unity_to_prefix_file_path _language _target _unityFile _prefixFileVar)
+ cotire_setup_file_extension_variables()
+ if (NOT DEFINED _unityFileExt_${_language})
+ set (${_prefixFileVar} "" PARENT_SCOPE)
+ return()
+ endif()
+ set (_unityFileBaseName "${_target}_${_language}${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}")
+ set (_prefixFileBaseName "${_target}_${_language}${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}")
+ string (REPLACE "${_unityFileBaseName}" "${_prefixFileBaseName}" _prefixFile "${_unityFile}")
+ string (REGEX REPLACE "${_unityFileExt_${_language}}$" "${_prefixFileExt_${_language}}" _prefixFile "${_prefixFile}")
+ set (${_prefixFileVar} "${_prefixFile}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_prefix_header_to_source_file_path _language _prefixHeaderFile _prefixSourceFileVar)
+ cotire_setup_file_extension_variables()
+ if (NOT DEFINED _prefixSourceFileExt_${_language})
+ set (${_prefixSourceFileVar} "" PARENT_SCOPE)
+ return()
+ endif()
+ string (REGEX REPLACE "${_prefixFileExt_${_language}}$" "${_prefixSourceFileExt_${_language}}" _prefixSourceFile "${_prefixHeaderFile}")
+ set (${_prefixSourceFileVar} "${_prefixSourceFile}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_make_prefix_file_name _language _target _prefixFileBaseNameVar _prefixFileNameVar)
+ cotire_setup_file_extension_variables()
+ if (NOT _language)
+ set (_prefixFileBaseName "${_target}${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}")
+ set (_prefixFileName "${_prefixFileBaseName}${_prefixFileExt_C}")
+ elseif (DEFINED _prefixFileExt_${_language})
+ set (_prefixFileBaseName "${_target}_${_language}${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}")
+ set (_prefixFileName "${_prefixFileBaseName}${_prefixFileExt_${_language}}")
+ else()
+ set (_prefixFileBaseName "")
+ set (_prefixFileName "")
+ endif()
+ set (${_prefixFileBaseNameVar} "${_prefixFileBaseName}" PARENT_SCOPE)
+ set (${_prefixFileNameVar} "${_prefixFileName}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_make_prefix_file_path _language _target _prefixFileVar)
+ cotire_make_prefix_file_name("${_language}" "${_target}" _prefixFileBaseName _prefixFileName)
+ set (${_prefixFileVar} "" PARENT_SCOPE)
+ if (_prefixFileName)
+ if (NOT _language)
+ set (_language "C")
+ endif()
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang|Intel|MSVC")
+ cotire_get_intermediate_dir(_baseDir)
+ set (${_prefixFileVar} "${_baseDir}/${_prefixFileName}" PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
+function (cotire_make_pch_file_path _language _target _pchFileVar)
+ cotire_make_prefix_file_name("${_language}" "${_target}" _prefixFileBaseName _prefixFileName)
+ set (${_pchFileVar} "" PARENT_SCOPE)
+ if (_prefixFileBaseName AND _prefixFileName)
+ cotire_check_precompiled_header_support("${_language}" "${_target}" _msg)
+ if (NOT _msg)
+ if (XCODE)
+ # For Xcode, we completely hand off the compilation of the prefix header to the IDE
+ return()
+ endif()
+ cotire_get_intermediate_dir(_baseDir)
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
+ # MSVC uses the extension .pch added to the prefix header base name
+ set (${_pchFileVar} "${_baseDir}/${_prefixFileBaseName}.pch" PARENT_SCOPE)
+ elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
+ # Clang looks for a precompiled header corresponding to the prefix header with the extension .pch appended
+ set (${_pchFileVar} "${_baseDir}/${_prefixFileName}.pch" PARENT_SCOPE)
+ elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
+ # GCC looks for a precompiled header corresponding to the prefix header with the extension .gch appended
+ set (${_pchFileVar} "${_baseDir}/${_prefixFileName}.gch" PARENT_SCOPE)
+ elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
+ # Intel uses the extension .pchi added to the prefix header base name
+ set (${_pchFileVar} "${_baseDir}/${_prefixFileBaseName}.pchi" PARENT_SCOPE)
+ endif()
+ endif()
+ endif()
+endfunction()
+
+function (cotire_select_unity_source_files _unityFile _sourcesVar)
+ set (_sourceFiles ${ARGN})
+ if (_sourceFiles AND "${_unityFile}" MATCHES "${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}_([0-9]+)_([0-9]+)")
+ set (_startIndex ${CMAKE_MATCH_1})
+ set (_endIndex ${CMAKE_MATCH_2})
+ list (LENGTH _sourceFiles _numberOfSources)
+ if (NOT _startIndex LESS _numberOfSources)
+ math (EXPR _startIndex "${_numberOfSources} - 1")
+ endif()
+ if (NOT _endIndex LESS _numberOfSources)
+ math (EXPR _endIndex "${_numberOfSources} - 1")
+ endif()
+ set (_files "")
+ foreach (_index RANGE ${_startIndex} ${_endIndex})
+ list (GET _sourceFiles ${_index} _file)
+ list (APPEND _files "${_file}")
+ endforeach()
+ else()
+ set (_files ${_sourceFiles})
+ endif()
+ set (${_sourcesVar} ${_files} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_unity_source_dependencies _language _target _dependencySourcesVar)
+ set (_dependencySources "")
+ # depend on target's generated source files
+ get_target_property(_targetSourceFiles ${_target} SOURCES)
+ cotire_get_objects_with_property_on(_generatedSources GENERATED SOURCE ${_targetSourceFiles})
+ if (_generatedSources)
+ # but omit all generated source files that have the COTIRE_EXCLUDED property set to true
+ cotire_get_objects_with_property_on(_excludedGeneratedSources COTIRE_EXCLUDED SOURCE ${_generatedSources})
+ if (_excludedGeneratedSources)
+ list (REMOVE_ITEM _generatedSources ${_excludedGeneratedSources})
+ endif()
+ # and omit all generated source files that have the COTIRE_DEPENDENCY property set to false explicitly
+ cotire_get_objects_with_property_off(_excludedNonDependencySources COTIRE_DEPENDENCY SOURCE ${_generatedSources})
+ if (_excludedNonDependencySources)
+ list (REMOVE_ITEM _generatedSources ${_excludedNonDependencySources})
+ endif()
+ if (_generatedSources)
+ list (APPEND _dependencySources ${_generatedSources})
+ endif()
+ endif()
+ if (COTIRE_DEBUG AND _dependencySources)
+ message (STATUS "${_language} ${_target} unity source dependencies: ${_dependencySources}")
+ endif()
+ set (${_dependencySourcesVar} ${_dependencySources} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_prefix_header_dependencies _language _target _dependencySourcesVar)
+ set (_dependencySources "")
+ # depend on target source files marked with custom COTIRE_DEPENDENCY property
+ get_target_property(_targetSourceFiles ${_target} SOURCES)
+ cotire_get_objects_with_property_on(_dependencySources COTIRE_DEPENDENCY SOURCE ${_targetSourceFiles})
+ if (COTIRE_DEBUG AND _dependencySources)
+ message (STATUS "${_language} ${_target} prefix header dependencies: ${_dependencySources}")
+ endif()
+ set (${_dependencySourcesVar} ${_dependencySources} PARENT_SCOPE)
+endfunction()
+
+function (cotire_generate_target_script _language _configurations _target _targetScriptVar _targetConfigScriptVar)
+ set (_targetSources ${ARGN})
+ cotire_get_prefix_header_dependencies(${_language} ${_target} COTIRE_TARGET_PREFIX_DEPENDS ${_targetSources})
+ cotire_get_unity_source_dependencies(${_language} ${_target} COTIRE_TARGET_UNITY_DEPENDS ${_targetSources})
+ # set up variables to be configured
+ set (COTIRE_TARGET_LANGUAGE "${_language}")
+ get_target_property(COTIRE_TARGET_IGNORE_PATH ${_target} COTIRE_PREFIX_HEADER_IGNORE_PATH)
+ cotire_add_sys_root_paths(COTIRE_TARGET_IGNORE_PATH)
+ get_target_property(COTIRE_TARGET_INCLUDE_PATH ${_target} COTIRE_PREFIX_HEADER_INCLUDE_PATH)
+ cotire_add_sys_root_paths(COTIRE_TARGET_INCLUDE_PATH)
+ get_target_property(COTIRE_TARGET_PRE_UNDEFS ${_target} COTIRE_UNITY_SOURCE_PRE_UNDEFS)
+ get_target_property(COTIRE_TARGET_POST_UNDEFS ${_target} COTIRE_UNITY_SOURCE_POST_UNDEFS)
+ get_target_property(COTIRE_TARGET_MAXIMUM_NUMBER_OF_INCLUDES ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
+ get_target_property(COTIRE_TARGET_INCLUDE_PRIORITY_PATH ${_target} COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH)
+ cotire_get_source_files_undefs(COTIRE_UNITY_SOURCE_PRE_UNDEFS COTIRE_TARGET_SOURCES_PRE_UNDEFS ${_targetSources})
+ cotire_get_source_files_undefs(COTIRE_UNITY_SOURCE_POST_UNDEFS COTIRE_TARGET_SOURCES_POST_UNDEFS ${_targetSources})
+ set (COTIRE_TARGET_CONFIGURATION_TYPES "${_configurations}")
+ foreach (_config ${_configurations})
+ string (TOUPPER "${_config}" _upperConfig)
+ cotire_get_target_include_directories(
+ "${_config}" "${_language}" "${_target}" COTIRE_TARGET_INCLUDE_DIRECTORIES_${_upperConfig} COTIRE_TARGET_SYSTEM_INCLUDE_DIRECTORIES_${_upperConfig})
+ cotire_get_target_compile_definitions(
+ "${_config}" "${_language}" "${_target}" COTIRE_TARGET_COMPILE_DEFINITIONS_${_upperConfig})
+ cotire_get_target_compiler_flags(
+ "${_config}" "${_language}" "${_target}" COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig})
+ cotire_get_source_files_compile_definitions(
+ "${_config}" "${_language}" COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig} ${_targetSources})
+ endforeach()
+ get_target_property(COTIRE_TARGET_${_language}_COMPILER_LAUNCHER ${_target} ${_language}_COMPILER_LAUNCHER)
+ # set up COTIRE_TARGET_SOURCES
+ set (COTIRE_TARGET_SOURCES "")
+ foreach (_sourceFile ${_targetSources})
+ get_source_file_property(_generated "${_sourceFile}" GENERATED)
+ if (_generated)
+ # use absolute paths for generated files only, retrieving the LOCATION property is an expensive operation
+ get_source_file_property(_sourceLocation "${_sourceFile}" LOCATION)
+ list (APPEND COTIRE_TARGET_SOURCES "${_sourceLocation}")
+ else()
+ list (APPEND COTIRE_TARGET_SOURCES "${_sourceFile}")
+ endif()
+ endforeach()
+ # copy variable definitions to cotire target script
+ get_cmake_property(_vars VARIABLES)
+ string (REGEX MATCHALL "COTIRE_[A-Za-z0-9_]+" _matchVars "${_vars}")
+ # omit COTIRE_*_INIT variables
+ string (REGEX MATCHALL "COTIRE_[A-Za-z0-9_]+_INIT" _initVars "${_matchVars}")
+ if (_initVars)
+ list (REMOVE_ITEM _matchVars ${_initVars})
+ endif()
+ # omit COTIRE_VERBOSE which is passed as a CMake define on command line
+ list (REMOVE_ITEM _matchVars COTIRE_VERBOSE)
+ set (_contents "")
+ set (_contentsHasGeneratorExpressions FALSE)
+ foreach (_var IN LISTS _matchVars ITEMS
+ XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
+ CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
+ CMAKE_${_language}_COMPILER_LAUNCHER CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
+ CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_${_language}_SEP
+ CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
+ CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
+ CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
+ CMAKE_${_language}_SOURCE_FILE_EXTENSIONS)
+ if (DEFINED ${_var})
+ string (REPLACE "\"" "\\\"" _value "${${_var}}")
+ set (_contents "${_contents}set (${_var} \"${_value}\")\n")
+ if (NOT _contentsHasGeneratorExpressions)
+ if ("${_value}" MATCHES "\\$<.*>")
+ set (_contentsHasGeneratorExpressions TRUE)
+ endif()
+ endif()
+ endif()
+ endforeach()
+ # generate target script file
+ get_filename_component(_moduleName "${COTIRE_CMAKE_MODULE_FILE}" NAME)
+ set (_targetCotireScript "${CMAKE_CURRENT_BINARY_DIR}/${_target}_${_language}_${_moduleName}")
+ cotire_write_file("CMAKE" "${_targetCotireScript}" "${_contents}" FALSE)
+ if (_contentsHasGeneratorExpressions)
+ # use file(GENERATE ...) to expand generator expressions in the target script at CMake generate-time
+ set (_configNameOrNoneGeneratorExpression "$<$<CONFIG:>:None>$<$<NOT:$<CONFIG:>>:$<CONFIGURATION>>")
+ set (_targetCotireConfigScript "${CMAKE_CURRENT_BINARY_DIR}/${_target}_${_language}_${_configNameOrNoneGeneratorExpression}_${_moduleName}")
+ file (GENERATE OUTPUT "${_targetCotireConfigScript}" INPUT "${_targetCotireScript}")
+ else()
+ set (_targetCotireConfigScript "${_targetCotireScript}")
+ endif()
+ set (${_targetScriptVar} "${_targetCotireScript}" PARENT_SCOPE)
+ set (${_targetConfigScriptVar} "${_targetCotireConfigScript}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
+ set (_sourceFiles ${ARGN})
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+ # for Visual Studio and Intel, we attach the precompiled header compilation to the host file
+ # the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
+ if (_sourceFiles)
+ set (_flags "")
+ cotire_add_pch_compilation_flags(
+ "${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+ "${_prefixFile}" "${_pchFile}" "${_hostFile}" _flags)
+ set_property (SOURCE ${_hostFile} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+ set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_OUTPUTS "${_pchFile}")
+ # make object file generated from host file depend on prefix header
+ set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
+ # mark host file as cotired to prevent it from being used in another cotired target
+ set_property (SOURCE ${_hostFile} PROPERTY COTIRE_TARGET "${_target}")
+ endif()
+ elseif ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ # for makefile based generator, we add a custom command to precompile the prefix header
+ if (_targetScript)
+ cotire_set_cmd_to_prologue(_cmds)
+ list (APPEND _cmds -P "${COTIRE_CMAKE_MODULE_FILE}" "precompile" "${_targetScript}" "${_prefixFile}" "${_pchFile}" "${_hostFile}")
+ if (MSVC_IDE)
+ file (TO_NATIVE_PATH "${_pchFile}" _pchFileLogPath)
+ else()
+ file (RELATIVE_PATH _pchFileLogPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
+ endif()
+ if (COTIRE_DEBUG)
+ message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
+ endif()
+ set_property (SOURCE "${_pchFile}" PROPERTY GENERATED TRUE)
+ add_custom_command(
+ OUTPUT "${_pchFile}"
+ COMMAND ${_cmds}
+ DEPENDS "${_prefixFile}"
+ IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ COMMENT "Building ${_language} precompiled header ${_pchFileLogPath}"
+ VERBATIM)
+ endif()
+ endif()
+endfunction()
+
+function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+ # for Visual Studio and Intel, we include the precompiled header in all but the host file
+ # the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
+ set (_sourceFiles ${ARGN})
+ list (LENGTH _sourceFiles _numberOfSourceFiles)
+ if (_numberOfSourceFiles GREATER 0)
+ # mark sources as cotired to prevent them from being used in another cotired target
+ set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
+ set (_flags "")
+ cotire_add_prefix_pch_inclusion_flags(
+ "${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+ "${_prefixFile}" "${_pchFile}" _flags)
+ set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+ # make object files generated from source files depend on precompiled header
+ set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_pchFile}")
+ endif()
+ elseif ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ set (_sourceFiles ${_hostFile} ${ARGN})
+ if (NOT _wholeTarget)
+ # for makefile based generator, we force the inclusion of the prefix header for a subset
+ # of the source files, if this is a multi-language target or has excluded files
+ set (_flags "")
+ cotire_add_prefix_pch_inclusion_flags(
+ "${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+ "${_prefixFile}" "${_pchFile}" _flags)
+ set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+ # mark sources as cotired to prevent them from being used in another cotired target
+ set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
+ endif()
+ # make object files generated from source files depend on precompiled header
+ set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_pchFile}")
+ endif()
+endfunction()
+
+function (cotire_setup_prefix_file_inclusion _language _target _prefixFile)
+ set (_sourceFiles ${ARGN})
+ # force the inclusion of the prefix header for the given source files
+ set (_flags "")
+ set (_pchFile "")
+ cotire_add_prefix_pch_inclusion_flags(
+ "${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+ "${_prefixFile}" "${_pchFile}" _flags)
+ set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+ # mark sources as cotired to prevent them from being used in another cotired target
+ set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
+ # make object files generated from source files depend on prefix header
+ set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
+endfunction()
+
+function (cotire_get_first_set_property_value _propertyValueVar _type _object)
+ set (_properties ${ARGN})
+ foreach (_property ${_properties})
+ get_property(_propertyValue ${_type} "${_object}" PROPERTY ${_property})
+ if (_propertyValue)
+ set (${_propertyValueVar} ${_propertyValue} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+ set (${_propertyValueVar} "" PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_combine_command _language _targetScript _joinedFile _cmdsVar)
+ set (_files ${ARGN})
+ set (_filesPaths "")
+ foreach (_file ${_files})
+ get_filename_component(_filePath "${_file}" ABSOLUTE)
+ list (APPEND _filesPaths "${_filePath}")
+ endforeach()
+ cotire_set_cmd_to_prologue(_prefixCmd)
+ list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "combine")
+ if (_targetScript)
+ list (APPEND _prefixCmd "${_targetScript}")
+ endif()
+ list (APPEND _prefixCmd "${_joinedFile}" ${_filesPaths})
+ if (COTIRE_DEBUG)
+ message (STATUS "add_custom_command: OUTPUT ${_joinedFile} COMMAND ${_prefixCmd} DEPENDS ${_files}")
+ endif()
+ set_property (SOURCE "${_joinedFile}" PROPERTY GENERATED TRUE)
+ if (MSVC_IDE)
+ file (TO_NATIVE_PATH "${_joinedFile}" _joinedFileLogPath)
+ else()
+ file (RELATIVE_PATH _joinedFileLogPath "${CMAKE_BINARY_DIR}" "${_joinedFile}")
+ endif()
+ get_filename_component(_joinedFileBaseName "${_joinedFile}" NAME_WE)
+ get_filename_component(_joinedFileExt "${_joinedFile}" EXT)
+ if (_language AND _joinedFileBaseName MATCHES "${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}$")
+ set (_comment "Generating ${_language} unity source ${_joinedFileLogPath}")
+ elseif (_language AND _joinedFileBaseName MATCHES "${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}$")
+ if (_joinedFileExt MATCHES "^\\.c")
+ set (_comment "Generating ${_language} prefix source ${_joinedFileLogPath}")
+ else()
+ set (_comment "Generating ${_language} prefix header ${_joinedFileLogPath}")
+ endif()
+ else()
+ set (_comment "Generating ${_joinedFileLogPath}")
+ endif()
+ add_custom_command(
+ OUTPUT "${_joinedFile}"
+ COMMAND ${_prefixCmd}
+ DEPENDS ${_files}
+ COMMENT "${_comment}"
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ VERBATIM)
+ list (APPEND ${_cmdsVar} COMMAND ${_prefixCmd})
+ set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
+ if (XCODE)
+ # for Xcode, we attach a pre-build action to generate the unity sources and prefix headers
+ set (_prefixFiles "")
+ foreach (_language ${_languages})
+ get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
+ if (_prefixFile)
+ list (APPEND _prefixFiles "${_prefixFile}")
+ endif()
+ endforeach()
+ set (_cmds ${ARGN})
+ list (LENGTH _prefixFiles _numberOfPrefixFiles)
+ if (_numberOfPrefixFiles GREATER 1)
+ # we also generate a generic, single prefix header which includes all language specific prefix headers
+ set (_language "")
+ set (_targetScript "")
+ cotire_make_prefix_file_path("${_language}" ${_target} _prefixHeader)
+ cotire_setup_combine_command("${_language}" "${_targetScript}" "${_prefixHeader}" _cmds ${_prefixFiles})
+ else()
+ set (_prefixHeader "${_prefixFiles}")
+ endif()
+ if (COTIRE_DEBUG)
+ message (STATUS "add_custom_command: TARGET ${_target} PRE_BUILD ${_cmds}")
+ endif()
+ # because CMake PRE_BUILD command does not support dependencies,
+ # we check dependencies explicity in cotire script mode when the pre-build action is run
+ add_custom_command(
+ TARGET "${_target}"
+ PRE_BUILD ${_cmds}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ COMMENT "Updating target ${_target} prefix headers"
+ VERBATIM)
+ # make Xcode precompile the generated prefix header with ProcessPCH and ProcessPCH++
+ set_target_properties(${_target} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
+ set_target_properties(${_target} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${_prefixHeader}")
+ elseif ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ # for makefile based generator, we force inclusion of the prefix header for all target source files
+ # if this is a single-language target without any excluded files
+ if (_wholeTarget)
+ set (_language "${_languages}")
+ # for Visual Studio and Intel, precompiled header inclusion is always done on the source file level
+ # see cotire_setup_pch_file_inclusion
+ if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+ get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
+ if (_prefixFile)
+ get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
+ set (_options COMPILE_OPTIONS)
+ cotire_add_prefix_pch_inclusion_flags(
+ "${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+ "${_prefixFile}" "${_pchFile}" _options)
+ set_property(TARGET ${_target} APPEND PROPERTY ${_options})
+ endif()
+ endif()
+ endif()
+ endif()
+endfunction()
+
+function (cotire_setup_unity_generation_commands _language _target _targetScript _targetConfigScript _unityFiles _cmdsVar)
+ set (_dependencySources "")
+ cotire_get_unity_source_dependencies(${_language} ${_target} _dependencySources ${ARGN})
+ foreach (_unityFile ${_unityFiles})
+ set_property (SOURCE "${_unityFile}" PROPERTY GENERATED TRUE)
+ # set up compiled unity source dependencies via OBJECT_DEPENDS
+ # this ensures that missing source files are generated before the unity file is compiled
+ if (COTIRE_DEBUG AND _dependencySources)
+ message (STATUS "${_unityFile} OBJECT_DEPENDS ${_dependencySources}")
+ endif()
+ if (_dependencySources)
+ # the OBJECT_DEPENDS property requires a list of full paths
+ set (_objectDependsPaths "")
+ foreach (_sourceFile ${_dependencySources})
+ get_source_file_property(_sourceLocation "${_sourceFile}" LOCATION)
+ list (APPEND _objectDependsPaths "${_sourceLocation}")
+ endforeach()
+ set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_objectDependsPaths})
+ endif()
+ if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+ # unity file compilation results in potentially huge object file, thus use /bigobj by default unter MSVC and Windows Intel
+ set_property (SOURCE "${_unityFile}" APPEND_STRING PROPERTY COMPILE_FLAGS "/bigobj")
+ endif()
+ cotire_set_cmd_to_prologue(_unityCmd)
+ list (APPEND _unityCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "unity" "${_targetConfigScript}" "${_unityFile}")
+ if (CMAKE_VERSION VERSION_LESS "3.1.0")
+ set (_unityCmdDepends "${_targetScript}")
+ else()
+ # CMake 3.1.0 supports generator expressions in arguments to DEPENDS
+ set (_unityCmdDepends "${_targetConfigScript}")
+ endif()
+ if (MSVC_IDE)
+ file (TO_NATIVE_PATH "${_unityFile}" _unityFileLogPath)
+ else()
+ file (RELATIVE_PATH _unityFileLogPath "${CMAKE_BINARY_DIR}" "${_unityFile}")
+ endif()
+ if (COTIRE_DEBUG)
+ message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_unityCmdDepends}")
+ endif()
+ add_custom_command(
+ OUTPUT "${_unityFile}"
+ COMMAND ${_unityCmd}
+ DEPENDS ${_unityCmdDepends}
+ COMMENT "Generating ${_language} unity source ${_unityFileLogPath}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ VERBATIM)
+ list (APPEND ${_cmdsVar} COMMAND ${_unityCmd})
+ endforeach()
+ set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_prefix_generation_command _language _target _targetScript _prefixFile _unityFiles _cmdsVar)
+ set (_sourceFiles ${ARGN})
+ set (_dependencySources "")
+ cotire_get_prefix_header_dependencies(${_language} ${_target} _dependencySources ${_sourceFiles})
+ cotire_set_cmd_to_prologue(_prefixCmd)
+ list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" ${_unityFiles})
+ set_property (SOURCE "${_prefixFile}" PROPERTY GENERATED TRUE)
+ if (COTIRE_DEBUG)
+ message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources}")
+ endif()
+ if (MSVC_IDE)
+ file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileLogPath)
+ else()
+ file (RELATIVE_PATH _prefixFileLogPath "${CMAKE_BINARY_DIR}" "${_prefixFile}")
+ endif()
+ get_filename_component(_prefixFileExt "${_prefixFile}" EXT)
+ if (_prefixFileExt MATCHES "^\\.c")
+ set (_comment "Generating ${_language} prefix source ${_prefixFileLogPath}")
+ else()
+ set (_comment "Generating ${_language} prefix header ${_prefixFileLogPath}")
+ endif()
+ # prevent pre-processing errors upon generating the prefix header when a target's generated include file does not yet exist
+ # we do not add a file-level dependency for the target's generated files though, because we only want to depend on their existence
+ # thus we make the prefix header generation depend on a custom helper target which triggers the generation of the files
+ set (_preTargetName "${_target}${COTIRE_PCH_TARGET_SUFFIX}_pre")
+ if (TARGET ${_preTargetName})
+ # custom helper target has already been generated while processing a different language
+ list (APPEND _dependencySources ${_preTargetName})
+ else()
+ get_target_property(_targetSourceFiles ${_target} SOURCES)
+ cotire_get_objects_with_property_on(_generatedSources GENERATED SOURCE ${_targetSourceFiles})
+ if (_generatedSources)
+ add_custom_target("${_preTargetName}" DEPENDS ${_generatedSources})
+ cotire_init_target("${_preTargetName}")
+ list (APPEND _dependencySources ${_preTargetName})
+ endif()
+ endif()
+ add_custom_command(
+ OUTPUT "${_prefixFile}" "${_prefixFile}.log"
+ COMMAND ${_prefixCmd}
+ DEPENDS ${_unityFiles} ${_dependencySources}
+ COMMENT "${_comment}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ VERBATIM)
+ list (APPEND ${_cmdsVar} COMMAND ${_prefixCmd})
+ set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_prefix_generation_from_unity_command _language _target _targetScript _prefixFile _unityFiles _cmdsVar)
+ set (_sourceFiles ${ARGN})
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
+ # GNU and Clang require indirect compilation of the prefix header to make them honor the system_header pragma
+ cotire_prefix_header_to_source_file_path(${_language} "${_prefixFile}" _prefixSourceFile)
+ else()
+ set (_prefixSourceFile "${_prefixFile}")
+ endif()
+ cotire_setup_prefix_generation_command(
+ ${_language} ${_target} "${_targetScript}"
+ "${_prefixSourceFile}" "${_unityFiles}" ${_cmdsVar} ${_sourceFiles})
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
+ # set up generation of a prefix source file which includes the prefix header
+ cotire_setup_combine_command(${_language} "${_targetScript}" "${_prefixFile}" _cmds ${_prefixSourceFile})
+ endif()
+ set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_prefix_generation_from_provided_command _language _target _targetScript _prefixFile _cmdsVar)
+ set (_prefixHeaderFiles ${ARGN})
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
+ # GNU and Clang require indirect compilation of the prefix header to make them honor the system_header pragma
+ cotire_prefix_header_to_source_file_path(${_language} "${_prefixFile}" _prefixSourceFile)
+ else()
+ set (_prefixSourceFile "${_prefixFile}")
+ endif()
+ cotire_setup_combine_command(${_language} "${_targetScript}" "${_prefixSourceFile}" _cmds ${_prefixHeaderFiles})
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
+ # set up generation of a prefix source file which includes the prefix header
+ cotire_setup_combine_command(${_language} "${_targetScript}" "${_prefixFile}" _cmds ${_prefixSourceFile})
+ endif()
+ set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_init_cotire_target_properties _target)
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER TRUE)
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD TRUE)
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_ADD_CLEAN SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_ADD_CLEAN FALSE)
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH "${CMAKE_SOURCE_DIR}")
+ cotire_check_is_path_relative_to("${CMAKE_BINARY_DIR}" _isRelative "${CMAKE_SOURCE_DIR}")
+ if (NOT _isRelative)
+ set_property(TARGET ${_target} APPEND PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH "${CMAKE_BINARY_DIR}")
+ endif()
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PATH SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PATH "")
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH "")
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_PRE_UNDEFS SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_PRE_UNDEFS "")
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_POST_UNDEFS SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_POST_UNDEFS "")
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT SET)
+ if (NOT _isSet)
+ set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY_UNITY")
+ endif()
+ get_property(_isSet TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES SET)
+ if (NOT _isSet)
+ if (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES)
+ set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES "${COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES}")
+ else()
+ set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES "")
+ endif()
+ endif()
+endfunction()
+
+function (cotire_make_target_message _target _languages _disableMsg _targetMsgVar)
+ get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
+ get_target_property(_targetAddSCU ${_target} COTIRE_ADD_UNITY_BUILD)
+ string (REPLACE ";" " " _languagesStr "${_languages}")
+ math (EXPR _numberOfExcludedFiles "${ARGC} - 4")
+ if (_numberOfExcludedFiles EQUAL 0)
+ set (_excludedStr "")
+ elseif (COTIRE_VERBOSE OR _numberOfExcludedFiles LESS 4)
+ string (REPLACE ";" ", " _excludedStr "excluding ${ARGN}")
+ else()
+ set (_excludedStr "excluding ${_numberOfExcludedFiles} files")
+ endif()
+ set (_targetMsg "")
+ if (NOT _languages)
+ set (_targetMsg "Target ${_target} cannot be cotired.")
+ if (_disableMsg)
+ set (_targetMsg "${_targetMsg} ${_disableMsg}")
+ endif()
+ elseif (NOT _targetUsePCH AND NOT _targetAddSCU)
+ set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build and precompiled header.")
+ if (_disableMsg)
+ set (_targetMsg "${_targetMsg} ${_disableMsg}")
+ endif()
+ elseif (NOT _targetUsePCH)
+ if (_excludedStr)
+ set (_targetMsg "${_languagesStr} target ${_target} cotired without precompiled header ${_excludedStr}.")
+ else()
+ set (_targetMsg "${_languagesStr} target ${_target} cotired without precompiled header.")
+ endif()
+ if (_disableMsg)
+ set (_targetMsg "${_targetMsg} ${_disableMsg}")
+ endif()
+ elseif (NOT _targetAddSCU)
+ if (_excludedStr)
+ set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build ${_excludedStr}.")
+ else()
+ set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build.")
+ endif()
+ else()
+ if (_excludedStr)
+ set (_targetMsg "${_languagesStr} target ${_target} cotired ${_excludedStr}.")
+ else()
+ set (_targetMsg "${_languagesStr} target ${_target} cotired.")
+ endif()
+ endif()
+ set (${_targetMsgVar} "${_targetMsg}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_choose_target_languages _target _targetLanguagesVar _wholeTargetVar)
+ set (_languages ${ARGN})
+ set (_allSourceFiles "")
+ set (_allExcludedSourceFiles "")
+ set (_allCotiredSourceFiles "")
+ set (_targetLanguages "")
+ set (_pchEligibleTargetLanguages "")
+ get_target_property(_targetType ${_target} TYPE)
+ get_target_property(_targetSourceFiles ${_target} SOURCES)
+ get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
+ get_target_property(_targetAddSCU ${_target} COTIRE_ADD_UNITY_BUILD)
+ set (_disableMsg "")
+ foreach (_language ${_languages})
+ get_target_property(_prefixHeader ${_target} COTIRE_${_language}_PREFIX_HEADER)
+ get_target_property(_unityBuildFile ${_target} COTIRE_${_language}_UNITY_SOURCE)
+ if (_prefixHeader OR _unityBuildFile)
+ message (STATUS "cotire: target ${_target} has already been cotired.")
+ set (${_targetLanguagesVar} "" PARENT_SCOPE)
+ return()
+ endif()
+ if (_targetUsePCH AND "${_language}" MATCHES "^C|CXX$" AND NOT "${CMAKE_${_language}_COMPILER_ID}" STREQUAL "")
+ cotire_check_precompiled_header_support("${_language}" "${_target}" _disableMsg)
+ if (_disableMsg)
+ set (_targetUsePCH FALSE)
+ endif()
+ endif()
+ set (_sourceFiles "")
+ set (_excludedSources "")
+ set (_cotiredSources "")
+ cotire_filter_language_source_files(${_language} ${_target} _sourceFiles _excludedSources _cotiredSources ${_targetSourceFiles})
+ if (_sourceFiles OR _excludedSources OR _cotiredSources)
+ list (APPEND _targetLanguages ${_language})
+ endif()
+ if (_sourceFiles)
+ list (APPEND _allSourceFiles ${_sourceFiles})
+ endif()
+ list (LENGTH _sourceFiles _numberOfSources)
+ if (NOT _numberOfSources LESS ${COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES})
+ list (APPEND _pchEligibleTargetLanguages ${_language})
+ endif()
+ if (_excludedSources)
+ list (APPEND _allExcludedSourceFiles ${_excludedSources})
+ endif()
+ if (_cotiredSources)
+ list (APPEND _allCotiredSourceFiles ${_cotiredSources})
+ endif()
+ endforeach()
+ set (_targetMsgLevel STATUS)
+ if (NOT _targetLanguages)
+ string (REPLACE ";" " or " _languagesStr "${_languages}")
+ set (_disableMsg "No ${_languagesStr} source files.")
+ set (_targetUsePCH FALSE)
+ set (_targetAddSCU FALSE)
+ endif()
+ if (_targetUsePCH)
+ if (_allCotiredSourceFiles)
+ cotire_get_source_file_property_values(_cotireTargets COTIRE_TARGET ${_allCotiredSourceFiles})
+ list (REMOVE_DUPLICATES _cotireTargets)
+ string (REPLACE ";" ", " _cotireTargetsStr "${_cotireTargets}")
+ set (_disableMsg "Target sources already include a precompiled header for target(s) ${_cotireTargets}.")
+ set (_disableMsg "${_disableMsg} Set target property COTIRE_ENABLE_PRECOMPILED_HEADER to FALSE for targets ${_target},")
+ set (_disableMsg "${_disableMsg} ${_cotireTargetsStr} to get a workable build system.")
+ set (_targetMsgLevel SEND_ERROR)
+ set (_targetUsePCH FALSE)
+ elseif (NOT _pchEligibleTargetLanguages)
+ set (_disableMsg "Too few applicable sources.")
+ set (_targetUsePCH FALSE)
+ elseif (XCODE AND _allExcludedSourceFiles)
+ # for Xcode, we cannot apply the precompiled header to individual sources, only to the whole target
+ set (_disableMsg "Exclusion of source files not supported for generator Xcode.")
+ set (_targetUsePCH FALSE)
+ elseif (XCODE AND "${_targetType}" STREQUAL "OBJECT_LIBRARY")
+ # for Xcode, we cannot apply the required PRE_BUILD action to generate the prefix header to an OBJECT_LIBRARY target
+ set (_disableMsg "Required PRE_BUILD action not supported for OBJECT_LIBRARY targets for generator Xcode.")
+ set (_targetUsePCH FALSE)
+ endif()
+ endif()
+ set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER ${_targetUsePCH})
+ set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD ${_targetAddSCU})
+ cotire_make_target_message(${_target} "${_targetLanguages}" "${_disableMsg}" _targetMsg ${_allExcludedSourceFiles})
+ if (_targetMsg)
+ if (NOT DEFINED COTIREMSG_${_target})
+ set (COTIREMSG_${_target} "")
+ endif()
+ if (COTIRE_VERBOSE OR NOT "${_targetMsgLevel}" STREQUAL "STATUS" OR
+ NOT "${COTIREMSG_${_target}}" STREQUAL "${_targetMsg}")
+ # cache message to avoid redundant messages on re-configure
+ set (COTIREMSG_${_target} "${_targetMsg}" CACHE INTERNAL "${_target} cotire message.")
+ message (${_targetMsgLevel} "${_targetMsg}")
+ endif()
+ endif()
+ list (LENGTH _targetLanguages _numberOfLanguages)
+ if (_numberOfLanguages GREATER 1 OR _allExcludedSourceFiles)
+ set (${_wholeTargetVar} FALSE PARENT_SCOPE)
+ else()
+ set (${_wholeTargetVar} TRUE PARENT_SCOPE)
+ endif()
+ set (${_targetLanguagesVar} ${_targetLanguages} PARENT_SCOPE)
+endfunction()
+
+function (cotire_compute_unity_max_number_of_includes _target _maxIncludesVar)
+ set (_sourceFiles ${ARGN})
+ get_target_property(_maxIncludes ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
+ if (_maxIncludes MATCHES "(-j|--parallel|--jobs) ?([0-9]*)")
+ set (_numberOfThreads "${CMAKE_MATCH_2}")
+ if (NOT _numberOfThreads)
+ # use all available cores
+ ProcessorCount(_numberOfThreads)
+ endif()
+ list (LENGTH _sourceFiles _numberOfSources)
+ math (EXPR _maxIncludes "(${_numberOfSources} + ${_numberOfThreads} - 1) / ${_numberOfThreads}")
+ elseif (NOT _maxIncludes MATCHES "[0-9]+")
+ set (_maxIncludes 0)
+ endif()
+ if (COTIRE_DEBUG)
+ message (STATUS "${_target} unity source max includes: ${_maxIncludes}")
+ endif()
+ set (${_maxIncludesVar} ${_maxIncludes} PARENT_SCOPE)
+endfunction()
+
+function (cotire_process_target_language _language _configurations _target _wholeTarget _cmdsVar)
+ set (${_cmdsVar} "" PARENT_SCOPE)
+ get_target_property(_targetSourceFiles ${_target} SOURCES)
+ set (_sourceFiles "")
+ set (_excludedSources "")
+ set (_cotiredSources "")
+ cotire_filter_language_source_files(${_language} ${_target} _sourceFiles _excludedSources _cotiredSources ${_targetSourceFiles})
+ if (NOT _sourceFiles AND NOT _cotiredSources)
+ return()
+ endif()
+ set (_cmds "")
+ # check for user provided unity source file list
+ get_property(_unitySourceFiles TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE_INIT)
+ if (NOT _unitySourceFiles)
+ set (_unitySourceFiles ${_sourceFiles} ${_cotiredSources})
+ endif()
+ cotire_generate_target_script(
+ ${_language} "${_configurations}" ${_target} _targetScript _targetConfigScript ${_unitySourceFiles})
+ # set up unity files for parallel compilation
+ cotire_compute_unity_max_number_of_includes(${_target} _maxIncludes ${_unitySourceFiles})
+ cotire_make_unity_source_file_paths(${_language} ${_target} ${_maxIncludes} _unityFiles ${_unitySourceFiles})
+ list (LENGTH _unityFiles _numberOfUnityFiles)
+ if (_numberOfUnityFiles EQUAL 0)
+ return()
+ elseif (_numberOfUnityFiles GREATER 1)
+ cotire_setup_unity_generation_commands(
+ ${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFiles}" _cmds ${_unitySourceFiles})
+ endif()
+ # set up single unity file for prefix header generation
+ cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFile)
+ cotire_setup_unity_generation_commands(
+ ${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFile}" _cmds ${_unitySourceFiles})
+ cotire_make_prefix_file_path(${_language} ${_target} _prefixFile)
+ # set up prefix header
+ if (_prefixFile)
+ # check for user provided prefix header files
+ get_property(_prefixHeaderFiles TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER_INIT)
+ if (_prefixHeaderFiles)
+ cotire_setup_prefix_generation_from_provided_command(
+ ${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" _cmds ${_prefixHeaderFiles})
+ else()
+ cotire_setup_prefix_generation_from_unity_command(
+ ${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_unityFile}" _cmds ${_unitySourceFiles})
+ endif()
+ # check if selected language has enough sources at all
+ list (LENGTH _sourceFiles _numberOfSources)
+ if (_numberOfSources LESS ${COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES})
+ set (_targetUsePCH FALSE)
+ else()
+ get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
+ endif()
+ if (_targetUsePCH)
+ cotire_make_pch_file_path(${_language} ${_target} _pchFile)
+ if (_pchFile)
+ # first file in _sourceFiles is passed as the host file
+ cotire_setup_pch_file_compilation(
+ ${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
+ cotire_setup_pch_file_inclusion(
+ ${_language} ${_target} ${_wholeTarget} "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
+ endif()
+ elseif (_prefixHeaderFiles)
+ # user provided prefix header must be included unconditionally
+ cotire_setup_prefix_file_inclusion(${_language} ${_target} "${_prefixFile}" ${_sourceFiles})
+ endif()
+ endif()
+ # mark target as cotired for language
+ set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE "${_unityFiles}")
+ if (_prefixFile)
+ set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER "${_prefixFile}")
+ if (_targetUsePCH AND _pchFile)
+ set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER "${_pchFile}")
+ endif()
+ endif()
+ set (${_cmdsVar} ${_cmds} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_clean_target _target)
+ set (_cleanTargetName "${_target}${COTIRE_CLEAN_TARGET_SUFFIX}")
+ if (NOT TARGET "${_cleanTargetName}")
+ cotire_set_cmd_to_prologue(_cmds)
+ get_filename_component(_outputDir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" ABSOLUTE)
+ list (APPEND _cmds -P "${COTIRE_CMAKE_MODULE_FILE}" "cleanup" "${_outputDir}" "${COTIRE_INTDIR}" "${_target}")
+ add_custom_target(${_cleanTargetName}
+ COMMAND ${_cmds}
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ COMMENT "Cleaning up target ${_target} cotire generated files"
+ VERBATIM)
+ cotire_init_target("${_cleanTargetName}")
+ endif()
+endfunction()
+
+function (cotire_setup_pch_target _languages _configurations _target)
+ if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ # for makefile based generators, we add a custom target to trigger the generation of the cotire related files
+ set (_dependsFiles "")
+ foreach (_language ${_languages})
+ set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE)
+ if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+ # Visual Studio and Intel only create precompiled header as a side effect
+ list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER)
+ endif()
+ cotire_get_first_set_property_value(_dependsFile TARGET ${_target} ${_props})
+ if (_dependsFile)
+ list (APPEND _dependsFiles "${_dependsFile}")
+ endif()
+ endforeach()
+ if (_dependsFiles)
+ set (_pchTargetName "${_target}${COTIRE_PCH_TARGET_SUFFIX}")
+ add_custom_target("${_pchTargetName}" DEPENDS ${_dependsFiles})
+ cotire_init_target("${_pchTargetName}")
+ cotire_add_to_pch_all_target(${_pchTargetName})
+ endif()
+ else()
+ # for other generators, we add the "clean all" target to clean up the precompiled header
+ cotire_setup_clean_all_target()
+ endif()
+endfunction()
+
+function (cotire_collect_unity_target_sources _target _languages _unityTargetSourcesVar)
+ get_target_property(_targetSourceFiles ${_target} SOURCES)
+ set (_unityTargetSources ${_targetSourceFiles})
+ foreach (_language ${_languages})
+ get_property(_unityFiles TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE)
+ if (_unityFiles)
+ # remove source files that are included in the unity source
+ set (_sourceFiles "")
+ set (_excludedSources "")
+ set (_cotiredSources "")
+ cotire_filter_language_source_files(${_language} ${_target} _sourceFiles _excludedSources _cotiredSources ${_targetSourceFiles})
+ if (_sourceFiles OR _cotiredSources)
+ list (REMOVE_ITEM _unityTargetSources ${_sourceFiles} ${_cotiredSources})
+ endif()
+ # add unity source files instead
+ list (APPEND _unityTargetSources ${_unityFiles})
+ endif()
+ endforeach()
+ set (${_unityTargetSourcesVar} ${_unityTargetSources} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_unity_target_pch_usage _languages _target)
+ foreach (_language ${_languages})
+ get_property(_unityFiles TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE)
+ if (_unityFiles)
+ get_property(_userPrefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER_INIT)
+ get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
+ if (_userPrefixFile AND _prefixFile)
+ # user provided prefix header must be included unconditionally by unity sources
+ cotire_setup_prefix_file_inclusion(${_language} ${_target} "${_prefixFile}" ${_unityFiles})
+ endif()
+ endif()
+ endforeach()
+endfunction()
+
+function (cotire_setup_unity_build_target _languages _configurations _target)
+ get_target_property(_unityTargetName ${_target} COTIRE_UNITY_TARGET_NAME)
+ if (NOT _unityTargetName)
+ set (_unityTargetName "${_target}${COTIRE_UNITY_BUILD_TARGET_SUFFIX}")
+ endif()
+ # determine unity target sub type
+ get_target_property(_targetType ${_target} TYPE)
+ if ("${_targetType}" STREQUAL "EXECUTABLE")
+ set (_unityTargetSubType "")
+ elseif (_targetType MATCHES "(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+ set (_unityTargetSubType "${CMAKE_MATCH_1}")
+ else()
+ message (WARNING "cotire: target ${_target} has unknown target type ${_targetType}.")
+ return()
+ endif()
+ # determine unity target sources
+ set (_unityTargetSources "")
+ cotire_collect_unity_target_sources(${_target} "${_languages}" _unityTargetSources)
+ # handle automatic Qt processing
+ get_target_property(_targetAutoMoc ${_target} AUTOMOC)
+ get_target_property(_targetAutoUic ${_target} AUTOUIC)
+ get_target_property(_targetAutoRcc ${_target} AUTORCC)
+ if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
+ # if the original target sources are subject to CMake's automatic Qt processing,
+ # also include implicitly generated <targetname>_automoc.cpp file
+ list (APPEND _unityTargetSources "${_target}_automoc.cpp")
+ set_property (SOURCE "${_target}_automoc.cpp" PROPERTY GENERATED TRUE)
+ endif()
+ # prevent AUTOMOC, AUTOUIC and AUTORCC properties from being set when the unity target is created
+ set (CMAKE_AUTOMOC OFF)
+ set (CMAKE_AUTOUIC OFF)
+ set (CMAKE_AUTORCC OFF)
+ if (COTIRE_DEBUG)
+ message (STATUS "add target ${_targetType} ${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources}")
+ endif()
+ # generate unity target
+ if ("${_targetType}" STREQUAL "EXECUTABLE")
+ add_executable(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
+ else()
+ add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
+ endif()
+ if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
+ # depend on the original target's implicity generated <targetname>_automoc target
+ add_dependencies(${_unityTargetName} ${_target}_automoc)
+ endif()
+ # copy output location properties
+ set (_outputDirProperties
+ ARCHIVE_OUTPUT_DIRECTORY ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
+ LIBRARY_OUTPUT_DIRECTORY LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
+ RUNTIME_OUTPUT_DIRECTORY RUNTIME_OUTPUT_DIRECTORY_<CONFIG>)
+ if (COTIRE_UNITY_OUTPUT_DIRECTORY)
+ set (_setDefaultOutputDir TRUE)
+ if (IS_ABSOLUTE "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
+ set (_outputDir "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
+ else()
+ # append relative COTIRE_UNITY_OUTPUT_DIRECTORY to target's actual output directory
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
+ cotire_resolve_config_properites("${_configurations}" _properties ${_outputDirProperties})
+ foreach (_property ${_properties})
+ get_property(_outputDir TARGET ${_target} PROPERTY ${_property})
+ if (_outputDir)
+ get_filename_component(_outputDir "${_outputDir}/${COTIRE_UNITY_OUTPUT_DIRECTORY}" ABSOLUTE)
+ set_property(TARGET ${_unityTargetName} PROPERTY ${_property} "${_outputDir}")
+ set (_setDefaultOutputDir FALSE)
+ endif()
+ endforeach()
+ if (_setDefaultOutputDir)
+ get_filename_component(_outputDir "${CMAKE_CURRENT_BINARY_DIR}/${COTIRE_UNITY_OUTPUT_DIRECTORY}" ABSOLUTE)
+ endif()
+ endif()
+ if (_setDefaultOutputDir)
+ set_target_properties(${_unityTargetName} PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY "${_outputDir}"
+ LIBRARY_OUTPUT_DIRECTORY "${_outputDir}"
+ RUNTIME_OUTPUT_DIRECTORY "${_outputDir}")
+ endif()
+ else()
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ ${_outputDirProperties})
+ endif()
+ # copy output name
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_<CONFIG>
+ LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_<CONFIG>
+ OUTPUT_NAME OUTPUT_NAME_<CONFIG>
+ RUNTIME_OUTPUT_NAME RUNTIME_OUTPUT_NAME_<CONFIG>
+ PREFIX <CONFIG>_POSTFIX SUFFIX
+ IMPORT_PREFIX IMPORT_SUFFIX)
+ # copy compile stuff
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ COMPILE_DEFINITIONS COMPILE_DEFINITIONS_<CONFIG>
+ COMPILE_FLAGS COMPILE_OPTIONS
+ Fortran_FORMAT Fortran_MODULE_DIRECTORY
+ INCLUDE_DIRECTORIES
+ INTERPROCEDURAL_OPTIMIZATION INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
+ POSITION_INDEPENDENT_CODE
+ C_COMPILER_LAUNCHER CXX_COMPILER_LAUNCHER
+ C_INCLUDE_WHAT_YOU_USE CXX_INCLUDE_WHAT_YOU_USE
+ C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN)
+ # copy compile features
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED
+ CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED
+ COMPILE_FEATURES)
+ # copy interface stuff
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN
+ COMPATIBLE_INTERFACE_STRING
+ INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS
+ INTERFACE_INCLUDE_DIRECTORIES INTERFACE_SOURCES
+ INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
+ INTERFACE_AUTOUIC_OPTIONS NO_SYSTEM_FROM_IMPORTED)
+ # copy link stuff
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ BUILD_WITH_INSTALL_RPATH INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
+ LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED
+ LINK_FLAGS LINK_FLAGS_<CONFIG>
+ LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_<CONFIG>
+ LINK_INTERFACE_MULTIPLICITY LINK_INTERFACE_MULTIPLICITY_<CONFIG>
+ LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
+ STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
+ NO_SONAME SOVERSION VERSION)
+ # copy cmake stuff
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
+ # copy Apple platform specific stuff
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
+ MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
+ OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST
+ IOS_INSTALL_COMBINED)
+ # copy Windows platform specific stuff
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ GNUtoMS
+ COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
+ COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
+ PDB_NAME PDB_NAME_<CONFIG> PDB_OUTPUT_DIRECTORY PDB_OUTPUT_DIRECTORY_<CONFIG>
+ VS_DESKTOP_EXTENSIONS_VERSION VS_DOTNET_REFERENCES VS_DOTNET_TARGET_FRAMEWORK_VERSION
+ VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE
+ VS_IOT_EXTENSIONS_VERSION VS_IOT_STARTUP_TASK
+ VS_KEYWORD VS_MOBILE_EXTENSIONS_VERSION
+ VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER
+ VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
+ VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
+ WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS)
+ # copy Android platform specific stuff
+ cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ ANDROID_API ANDROID_API_MIN ANDROID_GUI
+ ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES
+ ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR
+ ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES
+ ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH
+ ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE)
+ # use output name from original target
+ get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
+ if (NOT _targetOutputName)
+ set_property(TARGET ${_unityTargetName} PROPERTY OUTPUT_NAME "${_target}")
+ endif()
+ # use export symbol from original target
+ cotire_get_target_export_symbol("${_target}" _defineSymbol)
+ if (_defineSymbol)
+ set_property(TARGET ${_unityTargetName} PROPERTY DEFINE_SYMBOL "${_defineSymbol}")
+ if ("${_targetType}" STREQUAL "EXECUTABLE")
+ set_property(TARGET ${_unityTargetName} PROPERTY ENABLE_EXPORTS TRUE)
+ endif()
+ endif()
+ cotire_init_target(${_unityTargetName})
+ cotire_add_to_unity_all_target(${_unityTargetName})
+ set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_TARGET_NAME "${_unityTargetName}")
+endfunction(cotire_setup_unity_build_target)
+
+function (cotire_target _target)
+ set(_options "")
+ set(_oneValueArgs "")
+ set(_multiValueArgs LANGUAGES CONFIGURATIONS)
+ cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+ if (NOT _option_LANGUAGES)
+ get_property (_option_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+ endif()
+ if (NOT _option_CONFIGURATIONS)
+ cotire_get_configuration_types(_option_CONFIGURATIONS)
+ endif()
+ # check if cotire can be applied to target at all
+ cotire_is_target_supported(${_target} _isSupported)
+ if (NOT _isSupported)
+ get_target_property(_imported ${_target} IMPORTED)
+ get_target_property(_targetType ${_target} TYPE)
+ if (_imported)
+ message (WARNING "cotire: imported ${_targetType} target ${_target} cannot be cotired.")
+ else()
+ message (STATUS "cotire: ${_targetType} target ${_target} cannot be cotired.")
+ endif()
+ return()
+ endif()
+ # resolve alias
+ get_target_property(_aliasName ${_target} ALIASED_TARGET)
+ if (_aliasName)
+ if (COTIRE_DEBUG)
+ message (STATUS "${_target} is an alias. Applying cotire to aliased target ${_aliasName} instead.")
+ endif()
+ set (_target ${_aliasName})
+ endif()
+ # check if target needs to be cotired for build type
+ # when using configuration types, the test is performed at build time
+ cotire_init_cotire_target_properties(${_target})
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ if (CMAKE_BUILD_TYPE)
+ list (FIND _option_CONFIGURATIONS "${CMAKE_BUILD_TYPE}" _index)
+ else()
+ list (FIND _option_CONFIGURATIONS "None" _index)
+ endif()
+ if (_index EQUAL -1)
+ if (COTIRE_DEBUG)
+ message (STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} not cotired (${_option_CONFIGURATIONS})")
+ endif()
+ return()
+ endif()
+ endif()
+ # when not using configuration types, immediately create cotire intermediate dir
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ cotire_get_intermediate_dir(_baseDir)
+ file (MAKE_DIRECTORY "${_baseDir}")
+ endif()
+ # choose languages that apply to the target
+ cotire_choose_target_languages("${_target}" _targetLanguages _wholeTarget ${_option_LANGUAGES})
+ if (NOT _targetLanguages)
+ return()
+ endif()
+ set (_cmds "")
+ foreach (_language ${_targetLanguages})
+ cotire_process_target_language("${_language}" "${_option_CONFIGURATIONS}" ${_target} ${_wholeTarget} _cmd)
+ if (_cmd)
+ list (APPEND _cmds ${_cmd})
+ endif()
+ endforeach()
+ get_target_property(_targetAddSCU ${_target} COTIRE_ADD_UNITY_BUILD)
+ if (_targetAddSCU)
+ cotire_setup_unity_build_target("${_targetLanguages}" "${_option_CONFIGURATIONS}" ${_target})
+ endif()
+ get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
+ if (_targetUsePCH)
+ cotire_setup_target_pch_usage("${_targetLanguages}" ${_target} ${_wholeTarget} ${_cmds})
+ cotire_setup_pch_target("${_targetLanguages}" "${_option_CONFIGURATIONS}" ${_target})
+ if (_targetAddSCU)
+ cotire_setup_unity_target_pch_usage("${_targetLanguages}" ${_target})
+ endif()
+ endif()
+ get_target_property(_targetAddCleanTarget ${_target} COTIRE_ADD_CLEAN)
+ if (_targetAddCleanTarget)
+ cotire_setup_clean_target(${_target})
+ endif()
+endfunction(cotire_target)
+
+function (cotire_map_libraries _strategy _mappedLibrariesVar)
+ set (_mappedLibraries "")
+ foreach (_library ${ARGN})
+ if (_library MATCHES "^\\$<LINK_ONLY:(.+)>$")
+ set (_libraryName "${CMAKE_MATCH_1}")
+ set (_linkOnly TRUE)
+ else()
+ set (_libraryName "${_library}")
+ set (_linkOnly FALSE)
+ endif()
+ if ("${_strategy}" MATCHES "COPY_UNITY")
+ cotire_is_target_supported(${_libraryName} _isSupported)
+ if (_isSupported)
+ # use target's corresponding unity target, if available
+ get_target_property(_libraryUnityTargetName ${_libraryName} COTIRE_UNITY_TARGET_NAME)
+ if (TARGET "${_libraryUnityTargetName}")
+ if (_linkOnly)
+ list (APPEND _mappedLibraries "$<LINK_ONLY:${_libraryUnityTargetName}>")
+ else()
+ list (APPEND _mappedLibraries "${_libraryUnityTargetName}")
+ endif()
+ else()
+ list (APPEND _mappedLibraries "${_library}")
+ endif()
+ else()
+ list (APPEND _mappedLibraries "${_library}")
+ endif()
+ else()
+ list (APPEND _mappedLibraries "${_library}")
+ endif()
+ endforeach()
+ list (REMOVE_DUPLICATES _mappedLibraries)
+ set (${_mappedLibrariesVar} ${_mappedLibraries} PARENT_SCOPE)
+endfunction()
+
+function (cotire_target_link_libraries _target)
+ cotire_is_target_supported(${_target} _isSupported)
+ if (NOT _isSupported)
+ return()
+ endif()
+ get_target_property(_unityTargetName ${_target} COTIRE_UNITY_TARGET_NAME)
+ if (TARGET "${_unityTargetName}")
+ get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
+ if (COTIRE_DEBUG)
+ message (STATUS "unity target ${_unityTargetName} link strategy: ${_linkLibrariesStrategy}")
+ endif()
+ if ("${_linkLibrariesStrategy}" MATCHES "^(COPY|COPY_UNITY)$")
+ get_target_property(_linkLibraries ${_target} LINK_LIBRARIES)
+ if (_linkLibraries)
+ cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkLibraries ${_linkLibraries})
+ set_target_properties(${_unityTargetName} PROPERTIES LINK_LIBRARIES "${_unityLinkLibraries}")
+ if (COTIRE_DEBUG)
+ message (STATUS "unity target ${_unityTargetName} link libraries: ${_unityLinkLibraries}")
+ endif()
+ endif()
+ get_target_property(_interfaceLinkLibraries ${_target} INTERFACE_LINK_LIBRARIES)
+ if (_interfaceLinkLibraries)
+ cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkInterfaceLibraries ${_interfaceLinkLibraries})
+ set_target_properties(${_unityTargetName} PROPERTIES INTERFACE_LINK_LIBRARIES "${_unityLinkInterfaceLibraries}")
+ if (COTIRE_DEBUG)
+ message (STATUS "unity target ${_unityTargetName} interface link libraries: ${_unityLinkInterfaceLibraries}")
+ endif()
+ endif()
+ endif()
+ endif()
+endfunction(cotire_target_link_libraries)
+
+function (cotire_cleanup _binaryDir _cotireIntermediateDirName _targetName)
+ if (_targetName)
+ file (GLOB_RECURSE _cotireFiles "${_binaryDir}/${_targetName}*.*")
+ else()
+ file (GLOB_RECURSE _cotireFiles "${_binaryDir}/*.*")
+ endif()
+ # filter files in intermediate directory
+ set (_filesToRemove "")
+ foreach (_file ${_cotireFiles})
+ get_filename_component(_dir "${_file}" DIRECTORY)
+ get_filename_component(_dirName "${_dir}" NAME)
+ if ("${_dirName}" STREQUAL "${_cotireIntermediateDirName}")
+ list (APPEND _filesToRemove "${_file}")
+ endif()
+ endforeach()
+ if (_filesToRemove)
+ if (COTIRE_VERBOSE)
+ message (STATUS "cleaning up ${_filesToRemove}")
+ endif()
+ file (REMOVE ${_filesToRemove})
+ endif()
+endfunction()
+
+function (cotire_init_target _targetName)
+ if (COTIRE_TARGETS_FOLDER)
+ set_target_properties(${_targetName} PROPERTIES FOLDER "${COTIRE_TARGETS_FOLDER}")
+ endif()
+ set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_ALL TRUE)
+ if (MSVC_IDE)
+ set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
+ endif()
+endfunction()
+
+function (cotire_add_to_pch_all_target _pchTargetName)
+ set (_targetName "${COTIRE_PCH_ALL_TARGET_NAME}")
+ if (NOT TARGET "${_targetName}")
+ add_custom_target("${_targetName}"
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ VERBATIM)
+ cotire_init_target("${_targetName}")
+ endif()
+ cotire_setup_clean_all_target()
+ add_dependencies(${_targetName} ${_pchTargetName})
+endfunction()
+
+function (cotire_add_to_unity_all_target _unityTargetName)
+ set (_targetName "${COTIRE_UNITY_BUILD_ALL_TARGET_NAME}")
+ if (NOT TARGET "${_targetName}")
+ add_custom_target("${_targetName}"
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ VERBATIM)
+ cotire_init_target("${_targetName}")
+ endif()
+ cotire_setup_clean_all_target()
+ add_dependencies(${_targetName} ${_unityTargetName})
+endfunction()
+
+function (cotire_setup_clean_all_target)
+ set (_targetName "${COTIRE_CLEAN_ALL_TARGET_NAME}")
+ if (NOT TARGET "${_targetName}")
+ cotire_set_cmd_to_prologue(_cmds)
+ list (APPEND _cmds -P "${COTIRE_CMAKE_MODULE_FILE}" "cleanup" "${CMAKE_BINARY_DIR}" "${COTIRE_INTDIR}")
+ add_custom_target(${_targetName}
+ COMMAND ${_cmds}
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ COMMENT "Cleaning up all cotire generated files"
+ VERBATIM)
+ cotire_init_target("${_targetName}")
+ endif()
+endfunction()
+
+function (cotire)
+ set(_options "")
+ set(_oneValueArgs "")
+ set(_multiValueArgs LANGUAGES CONFIGURATIONS)
+ cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+ set (_targets ${_option_UNPARSED_ARGUMENTS})
+ foreach (_target ${_targets})
+ if (TARGET ${_target})
+ cotire_target(${_target} LANGUAGES ${_option_LANGUAGES} CONFIGURATIONS ${_option_CONFIGURATIONS})
+ else()
+ message (WARNING "cotire: ${_target} is not a target.")
+ endif()
+ endforeach()
+ foreach (_target ${_targets})
+ if (TARGET ${_target})
+ cotire_target_link_libraries(${_target})
+ endif()
+ endforeach()
+endfunction()
+
+if (CMAKE_SCRIPT_MODE_FILE)
+
+ # cotire is being run in script mode
+ # locate -P on command args
+ set (COTIRE_ARGC -1)
+ foreach (_index RANGE ${CMAKE_ARGC})
+ if (COTIRE_ARGC GREATER -1)
+ set (COTIRE_ARGV${COTIRE_ARGC} "${CMAKE_ARGV${_index}}")
+ math (EXPR COTIRE_ARGC "${COTIRE_ARGC} + 1")
+ elseif ("${CMAKE_ARGV${_index}}" STREQUAL "-P")
+ set (COTIRE_ARGC 0)
+ endif()
+ endforeach()
+
+ # include target script if available
+ if ("${COTIRE_ARGV2}" MATCHES "\\.cmake$")
+ # the included target scripts sets up additional variables relating to the target (e.g., COTIRE_TARGET_SOURCES)
+ include("${COTIRE_ARGV2}")
+ endif()
+
+ if (COTIRE_DEBUG)
+ message (STATUS "${COTIRE_ARGV0} ${COTIRE_ARGV1} ${COTIRE_ARGV2} ${COTIRE_ARGV3} ${COTIRE_ARGV4} ${COTIRE_ARGV5}")
+ endif()
+
+ if (NOT COTIRE_BUILD_TYPE)
+ set (COTIRE_BUILD_TYPE "None")
+ endif()
+ string (TOUPPER "${COTIRE_BUILD_TYPE}" _upperConfig)
+ set (_includeDirs ${COTIRE_TARGET_INCLUDE_DIRECTORIES_${_upperConfig}})
+ set (_systemIncludeDirs ${COTIRE_TARGET_SYSTEM_INCLUDE_DIRECTORIES_${_upperConfig}})
+ set (_compileDefinitions ${COTIRE_TARGET_COMPILE_DEFINITIONS_${_upperConfig}})
+ set (_compileFlags ${COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig}})
+ # check if target has been cotired for actual build type COTIRE_BUILD_TYPE
+ list (FIND COTIRE_TARGET_CONFIGURATION_TYPES "${COTIRE_BUILD_TYPE}" _index)
+ if (_index GREATER -1)
+ set (_sources ${COTIRE_TARGET_SOURCES})
+ set (_sourcesDefinitions ${COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig}})
+ else()
+ if (COTIRE_DEBUG)
+ message (STATUS "COTIRE_BUILD_TYPE=${COTIRE_BUILD_TYPE} not cotired (${COTIRE_TARGET_CONFIGURATION_TYPES})")
+ endif()
+ set (_sources "")
+ set (_sourcesDefinitions "")
+ endif()
+ set (_targetPreUndefs ${COTIRE_TARGET_PRE_UNDEFS})
+ set (_targetPostUndefs ${COTIRE_TARGET_POST_UNDEFS})
+ set (_sourcesPreUndefs ${COTIRE_TARGET_SOURCES_PRE_UNDEFS})
+ set (_sourcesPostUndefs ${COTIRE_TARGET_SOURCES_POST_UNDEFS})
+
+ if ("${COTIRE_ARGV1}" STREQUAL "unity")
+
+ if (XCODE)
+ # executing pre-build action under Xcode, check dependency on target script
+ set (_dependsOption DEPENDS "${COTIRE_ARGV2}")
+ else()
+ # executing custom command, no need to re-check for dependencies
+ set (_dependsOption "")
+ endif()
+
+ cotire_select_unity_source_files("${COTIRE_ARGV3}" _sources ${_sources})
+
+ cotire_generate_unity_source(
+ "${COTIRE_ARGV3}" ${_sources}
+ LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
+ SOURCES_COMPILE_DEFINITIONS ${_sourcesDefinitions}
+ PRE_UNDEFS ${_targetPreUndefs}
+ POST_UNDEFS ${_targetPostUndefs}
+ SOURCES_PRE_UNDEFS ${_sourcesPreUndefs}
+ SOURCES_POST_UNDEFS ${_sourcesPostUndefs}
+ ${_dependsOption})
+
+ elseif ("${COTIRE_ARGV1}" STREQUAL "prefix")
+
+ if (XCODE)
+ # executing pre-build action under Xcode, check dependency on unity file and prefix dependencies
+ set (_dependsOption DEPENDS "${COTIRE_ARGV4}" ${COTIRE_TARGET_PREFIX_DEPENDS})
+ else()
+ # executing custom command, no need to re-check for dependencies
+ set (_dependsOption "")
+ endif()
+
+ set (_files "")
+ foreach (_index RANGE 4 ${COTIRE_ARGC})
+ if (COTIRE_ARGV${_index})
+ list (APPEND _files "${COTIRE_ARGV${_index}}")
+ endif()
+ endforeach()
+
+ cotire_generate_prefix_header(
+ "${COTIRE_ARGV3}" ${_files}
+ COMPILER_LAUNCHER "${COTIRE_TARGET_${COTIRE_TARGET_LANGUAGE}_COMPILER_LAUNCHER}"
+ COMPILER_EXECUTABLE "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER}"
+ COMPILER_ARG1 ${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ARG1}
+ COMPILER_ID "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ID}"
+ COMPILER_VERSION "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_VERSION}"
+ LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
+ IGNORE_PATH "${COTIRE_TARGET_IGNORE_PATH};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH}"
+ INCLUDE_PATH ${COTIRE_TARGET_INCLUDE_PATH}
+ IGNORE_EXTENSIONS "${CMAKE_${COTIRE_TARGET_LANGUAGE}_SOURCE_FILE_EXTENSIONS};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS}"
+ INCLUDE_PRIORITY_PATH ${COTIRE_TARGET_INCLUDE_PRIORITY_PATH}
+ INCLUDE_DIRECTORIES ${_includeDirs}
+ SYSTEM_INCLUDE_DIRECTORIES ${_systemIncludeDirs}
+ COMPILE_DEFINITIONS ${_compileDefinitions}
+ COMPILE_FLAGS ${_compileFlags}
+ ${_dependsOption})
+
+ elseif ("${COTIRE_ARGV1}" STREQUAL "precompile")
+
+ set (_files "")
+ foreach (_index RANGE 5 ${COTIRE_ARGC})
+ if (COTIRE_ARGV${_index})
+ list (APPEND _files "${COTIRE_ARGV${_index}}")
+ endif()
+ endforeach()
+
+ cotire_precompile_prefix_header(
+ "${COTIRE_ARGV3}" "${COTIRE_ARGV4}" "${COTIRE_ARGV5}"
+ COMPILER_LAUNCHER "${COTIRE_TARGET_${COTIRE_TARGET_LANGUAGE}_COMPILER_LAUNCHER}"
+ COMPILER_EXECUTABLE "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER}"
+ COMPILER_ARG1 ${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ARG1}
+ COMPILER_ID "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ID}"
+ COMPILER_VERSION "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_VERSION}"
+ LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
+ INCLUDE_DIRECTORIES ${_includeDirs}
+ SYSTEM_INCLUDE_DIRECTORIES ${_systemIncludeDirs}
+ COMPILE_DEFINITIONS ${_compileDefinitions}
+ COMPILE_FLAGS ${_compileFlags})
+
+ elseif ("${COTIRE_ARGV1}" STREQUAL "combine")
+
+ if (COTIRE_TARGET_LANGUAGE)
+ set (_combinedFile "${COTIRE_ARGV3}")
+ set (_startIndex 4)
+ else()
+ set (_combinedFile "${COTIRE_ARGV2}")
+ set (_startIndex 3)
+ endif()
+ set (_files "")
+ foreach (_index RANGE ${_startIndex} ${COTIRE_ARGC})
+ if (COTIRE_ARGV${_index})
+ list (APPEND _files "${COTIRE_ARGV${_index}}")
+ endif()
+ endforeach()
+
+ if (XCODE)
+ # executing pre-build action under Xcode, check dependency on files to be combined
+ set (_dependsOption DEPENDS ${_files})
+ else()
+ # executing custom command, no need to re-check for dependencies
+ set (_dependsOption "")
+ endif()
+
+ if (COTIRE_TARGET_LANGUAGE)
+ cotire_generate_unity_source(
+ "${_combinedFile}" ${_files}
+ LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
+ ${_dependsOption})
+ else()
+ cotire_generate_unity_source("${_combinedFile}" ${_files} ${_dependsOption})
+ endif()
+
+ elseif ("${COTIRE_ARGV1}" STREQUAL "cleanup")
+
+ cotire_cleanup("${COTIRE_ARGV2}" "${COTIRE_ARGV3}" "${COTIRE_ARGV4}")
+
+ else()
+ message (FATAL_ERROR "cotire: unknown command \"${COTIRE_ARGV1}\".")
+ endif()
+
+else()
+
+ # cotire is being run in include mode
+ # set up all variable and property definitions
+
+ if (NOT DEFINED COTIRE_DEBUG_INIT)
+ if (DEFINED COTIRE_DEBUG)
+ set (COTIRE_DEBUG_INIT ${COTIRE_DEBUG})
+ else()
+ set (COTIRE_DEBUG_INIT FALSE)
+ endif()
+ endif()
+ option (COTIRE_DEBUG "Enable cotire debugging output?" ${COTIRE_DEBUG_INIT})
+
+ if (NOT DEFINED COTIRE_VERBOSE_INIT)
+ if (DEFINED COTIRE_VERBOSE)
+ set (COTIRE_VERBOSE_INIT ${COTIRE_VERBOSE})
+ else()
+ set (COTIRE_VERBOSE_INIT FALSE)
+ endif()
+ endif()
+ option (COTIRE_VERBOSE "Enable cotire verbose output?" ${COTIRE_VERBOSE_INIT})
+
+ set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS "inc;inl;ipp" CACHE STRING
+ "Ignore headers with the listed file extensions from the generated prefix header.")
+
+ set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH "" CACHE STRING
+ "Ignore headers from these directories when generating the prefix header.")
+
+ set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING
+ "Ignore sources with the listed file extensions from the generated unity source.")
+
+ set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "3" CACHE STRING
+ "Minimum number of sources in target required to enable use of precompiled header.")
+
+ if (NOT DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT)
+ if (DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES)
+ set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT ${COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES})
+ elseif ("${CMAKE_GENERATOR}" MATCHES "JOM|Ninja|Visual Studio")
+ # enable parallelization for generators that run multiple jobs by default
+ set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT "-j")
+ else()
+ set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT "0")
+ endif()
+ endif()
+ set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES "${COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT}" CACHE STRING
+ "Maximum number of source files to include in a single unity source file.")
+
+ if (NOT COTIRE_PREFIX_HEADER_FILENAME_SUFFIX)
+ set (COTIRE_PREFIX_HEADER_FILENAME_SUFFIX "_prefix")
+ endif()
+ if (NOT COTIRE_UNITY_SOURCE_FILENAME_SUFFIX)
+ set (COTIRE_UNITY_SOURCE_FILENAME_SUFFIX "_unity")
+ endif()
+ if (NOT COTIRE_INTDIR)
+ set (COTIRE_INTDIR "cotire")
+ endif()
+ if (NOT COTIRE_PCH_ALL_TARGET_NAME)
+ set (COTIRE_PCH_ALL_TARGET_NAME "all_pch")
+ endif()
+ if (NOT COTIRE_UNITY_BUILD_ALL_TARGET_NAME)
+ set (COTIRE_UNITY_BUILD_ALL_TARGET_NAME "all_unity")
+ endif()
+ if (NOT COTIRE_CLEAN_ALL_TARGET_NAME)
+ set (COTIRE_CLEAN_ALL_TARGET_NAME "clean_cotire")
+ endif()
+ if (NOT COTIRE_CLEAN_TARGET_SUFFIX)
+ set (COTIRE_CLEAN_TARGET_SUFFIX "_clean_cotire")
+ endif()
+ if (NOT COTIRE_PCH_TARGET_SUFFIX)
+ set (COTIRE_PCH_TARGET_SUFFIX "_pch")
+ endif()
+ if (MSVC)
+ # MSVC default PCH memory scaling factor of 100 percent (75 MB) is too small for template heavy C++ code
+ # use a bigger default factor of 170 percent (128 MB)
+ if (NOT DEFINED COTIRE_PCH_MEMORY_SCALING_FACTOR)
+ set (COTIRE_PCH_MEMORY_SCALING_FACTOR "170")
+ endif()
+ endif()
+ if (NOT COTIRE_UNITY_BUILD_TARGET_SUFFIX)
+ set (COTIRE_UNITY_BUILD_TARGET_SUFFIX "_unity")
+ endif()
+ if (NOT DEFINED COTIRE_TARGETS_FOLDER)
+ set (COTIRE_TARGETS_FOLDER "cotire")
+ endif()
+ if (NOT DEFINED COTIRE_UNITY_OUTPUT_DIRECTORY)
+ if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
+ # generated Ninja build files do not work if the unity target produces the same output file as the cotired target
+ set (COTIRE_UNITY_OUTPUT_DIRECTORY "unity")
+ else()
+ set (COTIRE_UNITY_OUTPUT_DIRECTORY "")
+ endif()
+ endif()
+
+ # define cotire cache variables
+
+ define_property(
+ CACHED_VARIABLE PROPERTY "COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH"
+ BRIEF_DOCS "Ignore headers from these directories when generating the prefix header."
+ FULL_DOCS
+ "The variable can be set to a semicolon separated list of include directories."
+ "If a header file is found in one of these directories or sub-directories, it will be excluded from the generated prefix header."
+ "If not defined, defaults to empty list."
+ )
+
+ define_property(
+ CACHED_VARIABLE PROPERTY "COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS"
+ BRIEF_DOCS "Ignore includes with the listed file extensions from the generated prefix header."
+ FULL_DOCS
+ "The variable can be set to a semicolon separated list of file extensions."
+ "If a header file extension matches one in the list, it will be excluded from the generated prefix header."
+ "Includes with an extension in CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS are always ignored."
+ "If not defined, defaults to inc;inl;ipp."
+ )
+
+ define_property(
+ CACHED_VARIABLE PROPERTY "COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS"
+ BRIEF_DOCS "Exclude sources with the listed file extensions from the generated unity source."
+ FULL_DOCS
+ "The variable can be set to a semicolon separated list of file extensions."
+ "If a source file extension matches one in the list, it will be excluded from the generated unity source file."
+ "Source files with an extension in CMAKE_<LANG>_IGNORE_EXTENSIONS are always excluded."
+ "If not defined, defaults to m;mm."
+ )
+
+ define_property(
+ CACHED_VARIABLE PROPERTY "COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES"
+ BRIEF_DOCS "Minimum number of sources in target required to enable use of precompiled header."
+ FULL_DOCS
+ "The variable can be set to an integer > 0."
+ "If a target contains less than that number of source files, cotire will not enable the use of the precompiled header for the target."
+ "If not defined, defaults to 3."
+ )
+
+ define_property(
+ CACHED_VARIABLE PROPERTY "COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES"
+ BRIEF_DOCS "Maximum number of source files to include in a single unity source file."
+ FULL_DOCS
+ "This may be set to an integer >= 0."
+ "If 0, cotire will only create a single unity source file."
+ "If a target contains more than that number of source files, cotire will create multiple unity source files for it."
+ "Can be set to \"-j\" to optimize the count of unity source files for the number of available processor cores."
+ "Can be set to \"-j jobs\" to optimize the number of unity source files for the given number of simultaneous jobs."
+ "Is used to initialize the target property COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES."
+ "Defaults to \"-j\" for the generators Visual Studio, JOM or Ninja. Defaults to 0 otherwise."
+ )
+
+ # define cotire directory properties
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_ENABLE_PRECOMPILED_HEADER"
+ BRIEF_DOCS "Modify build command of cotired targets added in this directory to make use of the generated precompiled header."
+ FULL_DOCS
+ "See target property COTIRE_ENABLE_PRECOMPILED_HEADER."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_ADD_UNITY_BUILD"
+ BRIEF_DOCS "Add a new target that performs a unity build for cotired targets added in this directory."
+ FULL_DOCS
+ "See target property COTIRE_ADD_UNITY_BUILD."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_ADD_CLEAN"
+ BRIEF_DOCS "Add a new target that cleans all cotire generated files for cotired targets added in this directory."
+ FULL_DOCS
+ "See target property COTIRE_ADD_CLEAN."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_PREFIX_HEADER_IGNORE_PATH"
+ BRIEF_DOCS "Ignore headers from these directories when generating the prefix header."
+ FULL_DOCS
+ "See target property COTIRE_PREFIX_HEADER_IGNORE_PATH."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_PREFIX_HEADER_INCLUDE_PATH"
+ BRIEF_DOCS "Honor headers from these directories when generating the prefix header."
+ FULL_DOCS
+ "See target property COTIRE_PREFIX_HEADER_INCLUDE_PATH."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH"
+ BRIEF_DOCS "Header paths matching one of these directories are put at the top of the prefix header."
+ FULL_DOCS
+ "See target property COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_UNITY_SOURCE_PRE_UNDEFS"
+ BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file before the inclusion of each source file."
+ FULL_DOCS
+ "See target property COTIRE_UNITY_SOURCE_PRE_UNDEFS."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_UNITY_SOURCE_POST_UNDEFS"
+ BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file after the inclusion of each source file."
+ FULL_DOCS
+ "See target property COTIRE_UNITY_SOURCE_POST_UNDEFS."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES"
+ BRIEF_DOCS "Maximum number of source files to include in a single unity source file."
+ FULL_DOCS
+ "See target property COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES."
+ )
+
+ define_property(
+ DIRECTORY PROPERTY "COTIRE_UNITY_LINK_LIBRARIES_INIT"
+ BRIEF_DOCS "Define strategy for setting up the unity target's link libraries."
+ FULL_DOCS
+ "See target property COTIRE_UNITY_LINK_LIBRARIES_INIT."
+ )
+
+ # define cotire target properties
+
+ define_property(
+ TARGET PROPERTY "COTIRE_ENABLE_PRECOMPILED_HEADER" INHERITED
+ BRIEF_DOCS "Modify this target's build command to make use of the generated precompiled header."
+ FULL_DOCS
+ "If this property is set to TRUE, cotire will modify the build command to make use of the generated precompiled header."
+ "Irrespective of the value of this property, cotire will setup custom commands to generate the unity source and prefix header for the target."
+ "For makefile based generators cotire will also set up a custom target to manually invoke the generation of the precompiled header."
+ "The target name will be set to this target's name with the suffix _pch appended."
+ "Inherited from directory."
+ "Defaults to TRUE."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_ADD_UNITY_BUILD" INHERITED
+ BRIEF_DOCS "Add a new target that performs a unity build for this target."
+ FULL_DOCS
+ "If this property is set to TRUE, cotire creates a new target of the same type that uses the generated unity source file instead of the target sources."
+ "Most of the relevant target properties will be copied from this target to the new unity build target."
+ "Target dependencies and linked libraries have to be manually set up for the new unity build target."
+ "The unity target name will be set to this target's name with the suffix _unity appended."
+ "Inherited from directory."
+ "Defaults to TRUE."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_ADD_CLEAN" INHERITED
+ BRIEF_DOCS "Add a new target that cleans all cotire generated files for this target."
+ FULL_DOCS
+ "If this property is set to TRUE, cotire creates a new target that clean all files (unity source, prefix header, precompiled header)."
+ "The clean target name will be set to this target's name with the suffix _clean_cotire appended."
+ "Inherited from directory."
+ "Defaults to FALSE."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_PREFIX_HEADER_IGNORE_PATH" INHERITED
+ BRIEF_DOCS "Ignore headers from these directories when generating the prefix header."
+ FULL_DOCS
+ "The property can be set to a list of directories."
+ "If a header file is found in one of these directories or sub-directories, it will be excluded from the generated prefix header."
+ "Inherited from directory."
+ "If not set, this property is initialized to \${CMAKE_SOURCE_DIR};\${CMAKE_BINARY_DIR}."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_PREFIX_HEADER_INCLUDE_PATH" INHERITED
+ BRIEF_DOCS "Honor headers from these directories when generating the prefix header."
+ FULL_DOCS
+ "The property can be set to a list of directories."
+ "If a header file is found in one of these directories or sub-directories, it will be included in the generated prefix header."
+ "If a header file is both selected by COTIRE_PREFIX_HEADER_IGNORE_PATH and COTIRE_PREFIX_HEADER_INCLUDE_PATH,"
+ "the option which yields the closer relative path match wins."
+ "Inherited from directory."
+ "If not set, this property is initialized to the empty list."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH" INHERITED
+ BRIEF_DOCS "Header paths matching one of these directories are put at the top of prefix header."
+ FULL_DOCS
+ "The property can be set to a list of directories."
+ "Header file paths matching one of these directories will be inserted at the beginning of the generated prefix header."
+ "Header files are sorted according to the order of the directories in the property."
+ "If not set, this property is initialized to the empty list."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_UNITY_SOURCE_PRE_UNDEFS" INHERITED
+ BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file before the inclusion of each target source file."
+ FULL_DOCS
+ "This may be set to a semicolon-separated list of preprocessor symbols."
+ "cotire will add corresponding #undef directives to the generated unit source file before each target source file."
+ "Inherited from directory."
+ "Defaults to empty string."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_UNITY_SOURCE_POST_UNDEFS" INHERITED
+ BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file after the inclusion of each target source file."
+ FULL_DOCS
+ "This may be set to a semicolon-separated list of preprocessor symbols."
+ "cotire will add corresponding #undef directives to the generated unit source file after each target source file."
+ "Inherited from directory."
+ "Defaults to empty string."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES" INHERITED
+ BRIEF_DOCS "Maximum number of source files to include in a single unity source file."
+ FULL_DOCS
+ "This may be set to an integer > 0."
+ "If a target contains more than that number of source files, cotire will create multiple unity build files for it."
+ "If not set, cotire will only create a single unity source file."
+ "Inherited from directory."
+ "Defaults to empty."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_<LANG>_UNITY_SOURCE_INIT"
+ BRIEF_DOCS "User provided unity source file to be used instead of the automatically generated one."
+ FULL_DOCS
+ "If set, cotire will only add the given file(s) to the generated unity source file."
+ "If not set, cotire will add all the target source files to the generated unity source file."
+ "The property can be set to a user provided unity source file."
+ "Defaults to empty."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_<LANG>_PREFIX_HEADER_INIT"
+ BRIEF_DOCS "User provided prefix header file to be used instead of the automatically generated one."
+ FULL_DOCS
+ "If set, cotire will add the given header file(s) to the generated prefix header file."
+ "If not set, cotire will generate a prefix header by tracking the header files included by the unity source file."
+ "The property can be set to a user provided prefix header file (e.g., stdafx.h)."
+ "Defaults to empty."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_UNITY_LINK_LIBRARIES_INIT" INHERITED
+ BRIEF_DOCS "Define strategy for setting up unity target's link libraries."
+ FULL_DOCS
+ "If this property is empty or set to NONE, the generated unity target's link libraries have to be set up manually."
+ "If this property is set to COPY, the unity target's link libraries will be copied from this target."
+ "If this property is set to COPY_UNITY, the unity target's link libraries will be copied from this target with considering existing unity targets."
+ "Inherited from directory."
+ "Defaults to empty."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_<LANG>_UNITY_SOURCE"
+ BRIEF_DOCS "Read-only property. The generated <LANG> unity source file(s)."
+ FULL_DOCS
+ "cotire sets this property to the path of the generated <LANG> single computation unit source file for the target."
+ "Defaults to empty string."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_<LANG>_PREFIX_HEADER"
+ BRIEF_DOCS "Read-only property. The generated <LANG> prefix header file."
+ FULL_DOCS
+ "cotire sets this property to the full path of the generated <LANG> language prefix header for the target."
+ "Defaults to empty string."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_<LANG>_PRECOMPILED_HEADER"
+ BRIEF_DOCS "Read-only property. The generated <LANG> precompiled header file."
+ FULL_DOCS
+ "cotire sets this property to the full path of the generated <LANG> language precompiled header binary for the target."
+ "Defaults to empty string."
+ )
+
+ define_property(
+ TARGET PROPERTY "COTIRE_UNITY_TARGET_NAME"
+ BRIEF_DOCS "The name of the generated unity build target corresponding to this target."
+ FULL_DOCS
+ "This property can be set to the desired name of the unity target that will be created by cotire."
+ "If not set, the unity target name will be set to this target's name with the suffix _unity appended."
+ "After this target has been processed by cotire, the property is set to the actual name of the generated unity target."
+ "Defaults to empty string."
+ )
+
+ # define cotire source properties
+
+ define_property(
+ SOURCE PROPERTY "COTIRE_EXCLUDED"
+ BRIEF_DOCS "Do not modify source file's build command."
+ FULL_DOCS
+ "If this property is set to TRUE, the source file's build command will not be modified to make use of the precompiled header."
+ "The source file will also be excluded from the generated unity source file."
+ "Source files that have their COMPILE_FLAGS property set will be excluded by default."
+ "Defaults to FALSE."
+ )
+
+ define_property(
+ SOURCE PROPERTY "COTIRE_DEPENDENCY"
+ BRIEF_DOCS "Add this source file to dependencies of the automatically generated prefix header file."
+ FULL_DOCS
+ "If this property is set to TRUE, the source file is added to dependencies of the generated prefix header file."
+ "If the file is modified, cotire will re-generate the prefix header source upon build."
+ "Defaults to FALSE."
+ )
+
+ define_property(
+ SOURCE PROPERTY "COTIRE_UNITY_SOURCE_PRE_UNDEFS"
+ BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file before the inclusion of this source file."
+ FULL_DOCS
+ "This may be set to a semicolon-separated list of preprocessor symbols."
+ "cotire will add corresponding #undef directives to the generated unit source file before this file is included."
+ "Defaults to empty string."
+ )
+
+ define_property(
+ SOURCE PROPERTY "COTIRE_UNITY_SOURCE_POST_UNDEFS"
+ BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file after the inclusion of this source file."
+ FULL_DOCS
+ "This may be set to a semicolon-separated list of preprocessor symbols."
+ "cotire will add corresponding #undef directives to the generated unit source file after this file is included."
+ "Defaults to empty string."
+ )
+
+ define_property(
+ SOURCE PROPERTY "COTIRE_START_NEW_UNITY_SOURCE"
+ BRIEF_DOCS "Start a new unity source file which includes this source file as the first one."
+ FULL_DOCS
+ "If this property is set to TRUE, cotire will complete the current unity file and start a new one."
+ "The new unity source file will include this source file as the first one."
+ "This property essentially works as a separator for unity source files."
+ "Defaults to FALSE."
+ )
+
+ define_property(
+ SOURCE PROPERTY "COTIRE_TARGET"
+ BRIEF_DOCS "Read-only property. Mark this source file as cotired for the given target."
+ FULL_DOCS
+ "cotire sets this property to the name of target, that the source file's build command has been altered for."
+ "Defaults to empty string."
+ )
+
+ message (STATUS "cotire ${COTIRE_CMAKE_MODULE_VERSION} loaded.")
+
+endif()
diff --git a/tools/cmake/helpers/generators.cmake b/tools/cmake/helpers/generators.cmake
new file mode 100644
index 0000000000..64f7c1f670
--- /dev/null
+++ b/tools/cmake/helpers/generators.cmake
@@ -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.
+
+find_package(PythonInterp REQUIRED)
+
+if(NOT PYTHONINTERP_FOUND)
+ message(STATUS "Python interpreter is not found")
+ message(STATUS "To install it type in the command line:")
+ message(STATUS "sudo apt-get install python")
+ message(FATAL_ERROR "Exiting!")
+endif(NOT PYTHONINTERP_FOUND)
+
+set(INTEFRACE_GENERATOR "${CMAKE_SOURCE_DIR}/tools/InterfaceGenerator/Generator.py")
+set(INTEFRACE_GENERATOR_CMD ${PYTHON_EXECUTABLE} -B ${INTEFRACE_GENERATOR})
+file(GLOB_RECURSE INTERFACE_GENERATOR_DEPENDENCIES "${CMAKE_SOURCE_DIR}/tools/InterfaceGenerator/*.*")
+
+macro(generate_interface ARG_XML_NAME ARG_NAMESPACE PARSER_TYPE)
+ string(REGEX MATCH "^[a-zA-Z_0-9]*[^.]" FILE_NAME ${ARG_XML_NAME}) # TODO: make expression more robust
+
+ set(HPP_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.h"
+ "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}_schema.h"
+ )
+
+ set(CPP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}_schema.cc")
+ set(FULL_XML_NAME "${CMAKE_CURRENT_SOURCE_DIR}/${ARG_XML_NAME}")
+
+ add_custom_command(
+ OUTPUT ${HPP_FILE} ${CPP_FILE}
+ COMMAND ${INTEFRACE_GENERATOR_CMD} ${FULL_XML_NAME} ${ARG_NAMESPACE} ${CMAKE_CURRENT_BINARY_DIR} "--parser-type" "${PARSER_TYPE}"
+ DEPENDS ${INTERFACE_GENERATOR_DEPENDENCIES} ${FULL_XML_NAME}
+ COMMENT "Generating files:\n ${HPP_FILE}\n ${CPP_FILE}\nfrom:\n ${FULL_XML_NAME} ..."
+ VERBATIM
+ )
+endmacro()
diff --git a/tools/cmake/helpers/platform.cmake b/tools/cmake/helpers/platform.cmake
new file mode 100644
index 0000000000..961b41d689
--- /dev/null
+++ b/tools/cmake/helpers/platform.cmake
@@ -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.
+
+# SDL build platform includes three necessary components:
+# OS, Architecture and SDK. Build parameters and sources code base
+# could be varied depends on these three components combination.
+#
+# Platform helpers provide functionality to get supported by SDL
+# OS, Architecture or SDK lists and specified for actual build these
+# variables values. Values could be passed to cmake as parameters
+# (f.e. "-DOS_WINDOWS=1 -DSDK_QT=1"), otherwise they will be detected
+# related to current build environment.
+#
+# Full list of supported cmake flags:
+# OS_POSIX
+# OS_WINDOWS
+# ARCH_X86
+# ARCH_X64
+# SDK_QT
+
+function(get_supported_os OS_LIST)
+ set(${OS_LIST} "posix" "win" PARENT_SCOPE)
+endfunction()
+
+function(get_supported_arch ARCH_LIST)
+ set(${ARCH_LIST} "x86" "x64" PARENT_SCOPE)
+endfunction()
+
+function(get_supported_sdk SDK_LIST)
+ set(${SDK_LIST} "qt" PARENT_SCOPE)
+endfunction()
+
+function(get_os OS)
+ if(OS_POSIX)
+ set(${OS} "posix" PARENT_SCOPE)
+ elseif(OS_WINDOWS)
+ set(${OS} "win" PARENT_SCOPE)
+ else()
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${OS} "posix" PARENT_SCOPE)
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+ set(${OS} "win" PARENT_SCOPE)
+ else()
+ message(FATAL_ERROR "Unsupported operation system")
+ endif()
+ endif()
+endfunction()
+
+function(get_arch ARCH)
+ if( CMAKE_SIZEOF_VOID_P MATCHES 8 )
+ # void ptr = 8 byte --> x86_64
+ set(${ARCH} "x64" PARENT_SCOPE)
+ elseif( CMAKE_SIZEOF_VOID_P MATCHES 4 )
+ # void ptr = 4 byte --> x86
+ set(${ARCH} "x86" PARENT_SCOPE)
+ else()
+ message(FATAL_ERROR "Unsupported architecture")
+ endif()
+endfunction(get_arch ARCH)
+
+function(get_sdk SDK)
+ if(SDK_QT)
+ set(${SDK} "qt" PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/tools/cmake/helpers/sources.cmake b/tools/cmake/helpers/sources.cmake
new file mode 100644
index 0000000000..657197eaac
--- /dev/null
+++ b/tools/cmake/helpers/sources.cmake
@@ -0,0 +1,167 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Sources helpers provide functionality to collect headers, source files
+# or any other files depends on current build settings (OS, Architecture, SDK).
+#
+# Files could be included or excluded to/from build for some platform by
+# platform-specific suffix adding to filename. For example file
+# sdl_source_file_posix_x86_qt.cc will be added only to build with parameters:
+# OS=posix ARCH=x86 SDK=qt but file sdl_source_file_win.cc to all builds
+# with OS=win option enabled. Suffixes could be mixed within filename randomly.
+#
+# Full list of supported suffixes:
+# posix
+# win
+# x86
+# x64
+# qt
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+
+function(filter_files_by_name FILES IGNORE_NAMES)
+ set(FILES_LOCAL ${${FILES}})
+ foreach(FILE_ENTRY ${${FILES}})
+ foreach(IGNORE_ENTRY ${IGNORE_NAMES})
+ if(${FILE_ENTRY} MATCHES ${IGNORE_ENTRY})
+ list(REMOVE_ITEM FILES_LOCAL ${FILE_ENTRY})
+ endif()
+ endforeach()
+ endforeach()
+ set(${FILES} ${FILES_LOCAL} PARENT_SCOPE)
+endfunction()
+
+function(filter_files_by_suffix FILES IGNORE_SUFFIXES)
+ set(FILES_LOCAL ${${FILES}})
+ foreach(FILE_ENTRY ${${FILES}})
+ foreach(IGNORE_ENTRY ${IGNORE_SUFFIXES})
+ if((${FILE_ENTRY} MATCHES "_${IGNORE_ENTRY}_") OR (${FILE_ENTRY} MATCHES "_${IGNORE_ENTRY}\\."))
+ list(REMOVE_ITEM FILES_LOCAL ${FILE_ENTRY})
+ endif()
+ endforeach()
+ endforeach()
+ set(${FILES} ${FILES_LOCAL} PARENT_SCOPE)
+endfunction()
+
+function(filter_files_by_os FILES)
+ set(FILES_LOCAL ${${FILES}})
+ get_supported_os(OS_LIST)
+ get_os(OS)
+ list(REMOVE_ITEM OS_LIST ${OS})
+ filter_files_by_suffix(FILES_LOCAL "${OS_LIST}")
+ set(${FILES} ${FILES_LOCAL} PARENT_SCOPE)
+endfunction()
+
+function(filter_files_by_arch FILES)
+ set(FILES_LOCAL ${${FILES}})
+ get_supported_arch(ARCH_LIST)
+ get_arch(ARCH)
+ list(REMOVE_ITEM ARCH_LIST ${ARCH})
+ filter_files_by_suffix(FILES_LOCAL "${ARCH_LIST}")
+ set(${FILES} ${FILES_LOCAL} PARENT_SCOPE)
+endfunction()
+
+function(filter_files_by_sdk FILES)
+ set(FILES_LOCAL ${${FILES}})
+ get_supported_sdk(SDK_LIST)
+ get_sdk(SDK)
+ if(SDK)
+ list(REMOVE_ITEM SDK_LIST ${SDK})
+ endif()
+ filter_files_by_suffix(FILES_LOCAL "${SDK_LIST}")
+ set(${FILES} ${FILES_LOCAL} PARENT_SCOPE)
+endfunction()
+
+function(filter_files FILES IGNORE_NAMES)
+ set(FILES_LOCAL ${${FILES}})
+ filter_files_by_name(FILES_LOCAL "${IGNORE_NAMES}")
+ filter_files_by_os(FILES_LOCAL)
+ filter_files_by_arch(FILES_LOCAL)
+ filter_files_by_sdk(FILES_LOCAL)
+ set(${FILES} ${FILES_LOCAL} PARENT_SCOPE)
+endfunction()
+
+function(collect_sources SOURCES PATHS)
+ set(OPTIONAL_ARG ${ARGN})
+ set(HEADERS_LOCAL)
+ set(SOURCES_LOCAL)
+ get_os(OS)
+
+ foreach(PATH_ENTRY ${PATHS})
+ file(GLOB_RECURSE SOURCES_TO_FILTER "${PATH_ENTRY}/*.c" "${PATH_ENTRY}/*.cc" "${PATH_ENTRY}/*.cpp")
+ filter_files(SOURCES_TO_FILTER "${OPTIONAL_ARG}")
+ list(APPEND SOURCES_LOCAL ${SOURCES_TO_FILTER})
+ set(SOURCES_TO_FILTER)
+ if(${OS} STREQUAL "win")
+ file(GLOB_RECURSE HEADERS_TO_FILTER "${PATH_ENTRY}/*.h" "${PATH_ENTRY}/*.hpp")
+ filter_files(HEADERS_TO_FILTER "${OPTIONAL_ARG}")
+ list(APPEND HEADERS_LOCAL ${HEADERS_TO_FILTER})
+ set(HEADERS_TO_FILTER)
+ endif()
+ endforeach()
+
+ if(${OS} STREQUAL "win")
+ source_group("Header Files" FILES ${HEADERS_LOCAL})
+ source_group("Source Files" FILES ${SOURCES_LOCAL})
+ endif()
+ set(${SOURCES} ${SOURCES_LOCAL} PARENT_SCOPE)
+endfunction()
+
+function(create_test NAME SOURCES LIBS)
+ add_executable("${NAME}" ${CMAKE_SOURCE_DIR}/src/components/test_main.cc ${SOURCES})
+ target_link_libraries("${NAME}" ${LIBS})
+ target_link_libraries("${NAME}" Utils)
+ add_test(NAME ${NAME}
+ COMMAND ${NAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/)
+endfunction()
+
+function(create_cotired_test NAME SOURCES LIBS)
+ list(APPEND SOURCES
+ ${CMAKE_SOURCE_DIR}/src/components/test_main.cc)
+ add_executable(
+ ${NAME}
+ EXCLUDE_FROM_ALL
+ ${SOURCES}
+ )
+ # TODO: Fix problems with Cotire on Windows and Qt APPLINK-28060
+ if(${USE_COTIRE} AND (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
+ include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/cotire.cmake)
+ cotire(${NAME})
+ set(NAME "${NAME}_unity")
+ endif()
+ target_link_libraries(${NAME} ${LIBS})
+ set_target_properties(
+ ${NAME}
+ PROPERTIES
+ EXCLUDE_FROM_ALL 0
+ )
+ add_test(NAME ${NAME}
+ COMMAND ${NAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/)
+endfunction()
diff --git a/cmake/Modules/FindGlib-2.0.cmake b/tools/cmake/modules/FindGlib-2.0.cmake
index b39da141c9..b39da141c9 100644
--- a/cmake/Modules/FindGlib-2.0.cmake
+++ b/tools/cmake/modules/FindGlib-2.0.cmake
diff --git a/cmake/Modules/FindGstreamer-1.0.cmake b/tools/cmake/modules/FindGstreamer-1.0.cmake
index 8f1d69d01b..8f1d69d01b 100644
--- a/cmake/Modules/FindGstreamer-1.0.cmake
+++ b/tools/cmake/modules/FindGstreamer-1.0.cmake
diff --git a/cmake/Modules/FindLibXML2.cmake b/tools/cmake/modules/FindLibXML2.cmake
index 1daaeb07b7..1daaeb07b7 100644
--- a/cmake/Modules/FindLibXML2.cmake
+++ b/tools/cmake/modules/FindLibXML2.cmake
diff --git a/cmake/Modules/FindQt5Core.cmake b/tools/cmake/modules/FindQt5Core.cmake
index 1a2ad84842..1a2ad84842 100644
--- a/cmake/Modules/FindQt5Core.cmake
+++ b/tools/cmake/modules/FindQt5Core.cmake
diff --git a/cmake/Modules/FindQt5DBus.cmake b/tools/cmake/modules/FindQt5DBus.cmake
index d850010e97..d850010e97 100644
--- a/cmake/Modules/FindQt5DBus.cmake
+++ b/tools/cmake/modules/FindQt5DBus.cmake
diff --git a/cmake/Modules/FindQt5Qml.cmake b/tools/cmake/modules/FindQt5Qml.cmake
index f4bdaa8f71..f4bdaa8f71 100644
--- a/cmake/Modules/FindQt5Qml.cmake
+++ b/tools/cmake/modules/FindQt5Qml.cmake
diff --git a/cmake/Modules/FindQt5Quick.cmake b/tools/cmake/modules/FindQt5Quick.cmake
index 1e16340c2e..1e16340c2e 100644
--- a/cmake/Modules/FindQt5Quick.cmake
+++ b/tools/cmake/modules/FindQt5Quick.cmake
diff --git a/tools/cmake/modules/FindSDLGstreamer.cmake b/tools/cmake/modules/FindSDLGstreamer.cmake
new file mode 100644
index 0000000000..515404d39b
--- /dev/null
+++ b/tools/cmake/modules/FindSDLGstreamer.cmake
@@ -0,0 +1,42 @@
+# - Try to find Gstreamer
+#
+# GSTREAMER_INCLUDE_DIRECTORY - the Gstreamer include directory
+# GSTREAMER_LIBRARIES - the Gstreamer libraries
+
+get_os(OS)
+if(${OS} STREQUAL "posix")
+ 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(GSTREAMER_INCLUDE_DIRECTORY
+ ${GSTREAMER_gst_INCLUDE_DIR}
+ ${GLIB_glib_2_INCLUDE_DIR}
+ )
+ set(GSTREAMER_LIBRARIES
+ ${GSTREAMER_gstreamer_LIBRARY}
+ gobject-2.0
+ glib-2.0
+ )
+elseif(${OS} STREQUAL "win")
+ get_sdk(SDK)
+ if(NOT SDK)
+ if(EXISTS $ENV{SDL_GSTREAMER_DIR})
+ set(GSTREAMER_DIR $ENV{SDL_GSTREAMER_DIR})
+ else()
+ message(FATAL_ERROR "Could not find GSTREAMER (Check SDL_GSTREAMER_DIR environment variable)")
+ endif()
+ set(GSTREAMER_INCLUDE_DIRECTORY
+ ${GSTREAMER_DIR}/include/gstreamer-0.10
+ ${GSTREAMER_DIR}/include/libxml2
+ ${GSTREAMER_DIR}/include/glib-2.0
+ ${GSTREAMER_DIR}/lib/glib-2.0/include
+ )
+ set(GSTREAMER_LIBRARIES
+ ${GSTREAMER_DIR}/lib/gstreamer-0.10.lib
+ ${GSTREAMER_DIR}/lib/glib-2.0.lib
+ ${GSTREAMER_DIR}/lib/gobject-2.0.lib
+ )
+ endif()
+endif()
diff --git a/tools/cmake/modules/FindSDLLibUSB.cmake b/tools/cmake/modules/FindSDLLibUSB.cmake
new file mode 100644
index 0000000000..0082d62315
--- /dev/null
+++ b/tools/cmake/modules/FindSDLLibUSB.cmake
@@ -0,0 +1,19 @@
+# - Try to find libusb
+#
+# LIBUSB_INCLUDE_DIRECTORY - the libusb include directory
+# LIBUSB_LIBRARIES - libusb libraries to link
+
+get_os(OS)
+if(${OS} STREQUAL "posix")
+ set(LIBUSB_INCLUDE_DIRECTORY /usr/include/libusb-1.0)
+ set(LIBUSB_LIBRARIES usb-1.0 udev)
+elseif(${OS} STREQUAL "win")
+ get_arch(ARCH)
+ if(${ARCH} STREQUAL "x86")
+ set(LIBUSB_DIR ${CMAKE_SOURCE_DIR}/build/libusbx_win_x86)
+ elseif(${ARCH} STREQUAL "x64")
+ set(LIBUSB_DIR ${CMAKE_SOURCE_DIR}/build/libusbx_win_x64)
+ endif()
+ set(LIBUSB_INCLUDE_DIRECTORY ${LIBUSB_DIR}/libusb)
+ set(LIBUSB_LIBRARIES ${LIBUSB_DIR}/bin/libusb-1.0.lib)
+endif()
diff --git a/tools/cmake/modules/FindSDLOpenSSL.cmake b/tools/cmake/modules/FindSDLOpenSSL.cmake
new file mode 100644
index 0000000000..c16236a1cb
--- /dev/null
+++ b/tools/cmake/modules/FindSDLOpenSSL.cmake
@@ -0,0 +1,18 @@
+# - Try to find OpenSSL
+#
+# OPENSSL_INCLUDE_DIRECTORY - the OpenSSL include directory
+# OPENSSL_LIBRARIES - the OpenSSL libraries
+
+get_os(OS)
+if(${OS} STREQUAL "posix")
+ find_package(OpenSSL REQUIRED)
+elseif(${OS} STREQUAL "win")
+ get_arch(ARCH)
+ if(${ARCH} STREQUAL "x86")
+ set(OPENSSL_DIR ${CMAKE_SOURCE_DIR}/build/openssl_win_x86)
+ elseif(${ARCH} STREQUAL "x64")
+ set(OPENSSL_DIR ${CMAKE_SOURCE_DIR}/build/openssl_win_x64)
+ endif()
+ set(OPENSSL_INCLUDE_DIRECTORY ${OPENSSL_DIR}/include)
+ set(OPENSSL_LIBRARIES ${OPENSSL_DIR}/lib/libeay32.lib ${OPENSSL_DIR}/lib/ssleay32.lib)
+endif()
diff --git a/tools/cmake/modules/FindSqlite3.cmake b/tools/cmake/modules/FindSqlite3.cmake
new file mode 100644
index 0000000000..f6bdcad69c
--- /dev/null
+++ b/tools/cmake/modules/FindSqlite3.cmake
@@ -0,0 +1,81 @@
+# - Try to find Sqlite3
+# Once done this will define
+#
+# SQLITE3_FOUND - system has Sqlite3
+# SQLITE3_INCLUDE_DIRS - the Sqlite3 include directory
+# SQLITE3_LIBRARIES - Link these to use Sqlite3
+# SQLITE3_DEFINITIONS - Compiler switches required for using Sqlite3
+#
+# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
+ set(SQLITE3_FOUND TRUE)
+else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_SQLITE3 REQUIRED sqlite3>=3.7.11)
+ else (PKG_CONFIG_FOUND)
+ message(WARNING "PkgConfig isn't installed. You need to sure sqlite3>=3.7.11")
+ endif (PKG_CONFIG_FOUND)
+
+ find_path(SQLITE3_INCLUDE_DIR
+ NAMES
+ sqlite3.h
+ PATHS
+ ${_SQLITE3_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ )
+
+ find_library(SQLITE3_LIBRARY
+ NAMES
+ sqlite3
+ PATHS
+ ${_SQLITE3_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (SQLITE3_LIBRARY)
+ set(SQLITE3_FOUND TRUE)
+ endif (SQLITE3_LIBRARY)
+
+ set(SQLITE3_INCLUDE_DIRS
+ ${SQLITE3_INCLUDE_DIR}
+ )
+
+ if (SQLITE3_FOUND)
+ set(SQLITE3_LIBRARIES
+ ${SQLITE3_LIBRARIES}
+ ${SQLITE3_LIBRARY}
+ )
+ endif (SQLITE3_FOUND)
+
+ if (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
+ set(SQLITE3_FOUND TRUE)
+ endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
+
+ if (SQLITE3_FOUND)
+ if (NOT Sqlite3_FIND_QUIETLY)
+ message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES}")
+ endif (NOT Sqlite3_FIND_QUIETLY)
+ else (SQLITE3_FOUND)
+ if (Sqlite3_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find Sqlite3")
+ endif (Sqlite3_FIND_REQUIRED)
+ endif (SQLITE3_FOUND)
+
+ # show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view
+ mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
+
+endif (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) \ No newline at end of file
diff --git a/tools/cmake/modules/FindUDev.cmake b/tools/cmake/modules/FindUDev.cmake
new file mode 100644
index 0000000000..cdc8743777
--- /dev/null
+++ b/tools/cmake/modules/FindUDev.cmake
@@ -0,0 +1,53 @@
+# razor-de: Configure libudev environment
+#
+# UDEV_FOUND - system has a libudev
+# UDEV_INCLUDE_DIR - where to find header files
+# UDEV_LIBRARIES - the libraries to link against udev
+# UDEV_STABLE - it's true when is the version greater or equals to 143 - version when the libudev was stabilized in its API
+#
+# copyright (c) 2011 Petr Vanek <petr@scribus.info>
+# Redistribution and use is allowed according to the terms of the BSD license.
+#
+
+FIND_PATH(
+ UDEV_INCLUDE_DIR
+ libudev.h
+ /usr/include
+ /usr/local/include
+ ${UDEV_PATH_INCLUDES}
+)
+
+FIND_LIBRARY(
+ UDEV_LIBRARIES
+ NAMES udev libudev
+ PATHS
+ /usr/lib${LIB_SUFFIX}
+ /usr/local/lib${LIB_SUFFIX}
+ ${UDEV_PATH_LIB}
+)
+
+IF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
+ SET(UDEV_FOUND "YES")
+ execute_process(COMMAND pkg-config --atleast-version=143 libudev RESULT_VARIABLE UDEV_STABLE)
+ # retvale is 0 of the condition is "true" so we need to negate the value...
+ if (UDEV_STABLE)
+set(UDEV_STABLE 0)
+ else (UDEV_STABLE)
+set(UDEV_STABLE 1)
+ endif (UDEV_STABLE)
+ message(STATUS "libudev stable: ${UDEV_STABLE}")
+ENDIF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
+
+IF (UDEV_FOUND)
+ MESSAGE(STATUS "Found UDev: ${UDEV_LIBRARIES}")
+ MESSAGE(STATUS " include: ${UDEV_INCLUDE_DIR}")
+ELSE (UDEV_FOUND)
+ MESSAGE(STATUS "UDev not found.")
+ MESSAGE(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
+ MESSAGE(STATUS " currently found includes: ${UDEV_INCLUDE_DIR}")
+ MESSAGE(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
+ MESSAGE(STATUS " currently found libs: ${UDEV_LIBRARIES}")
+ IF (UDev_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find UDev library")
+ ENDIF (UDev_FIND_REQUIRED)
+ENDIF (UDEV_FOUND) \ No newline at end of file
diff --git a/tools/infrastructure/api_compare.py b/tools/infrastructure/api_compare.py
new file mode 100644
index 0000000000..0129119673
--- /dev/null
+++ b/tools/infrastructure/api_compare.py
@@ -0,0 +1,468 @@
+#!/usr/bin/env python
+
+import json
+import sys
+import errno
+import argparse
+import xml.etree.ElementTree as ElementTree
+from collections import namedtuple
+
+reload(sys)
+# Enable Utf-8 support. Needed if script will be run under Windows
+sys.setdefaultencoding('utf-8')
+
+
+class colors:
+ """Class defining colorful output.
+ Works under UNIX ONLY as Windows does not support ANSI escape sequences
+ """
+ HEADER = '\033[95m'
+ BLUE = '\033[94m'
+ GREEN = '\033[92m'
+ WARN = '\033[93m'
+ FAIL = '\033[91m'
+ ENDC = '\033[0m'
+ BOLD = '\033[1m'
+ UNDERLINE = '\033[4m'
+
+
+def simple_values_comparison(mobile_attribute_value, hmi_attribute_value):
+ """Simple attribute value comparison"""
+ return mobile_attribute_value == hmi_attribute_value
+
+
+def parse_command_line_args():
+ """Function adds and parses command line arguments"""
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "--mobile_api_file",
+ type=str, default="MOBILE_API.xml",
+ help='Enter mobile api file name! ("MOBILE_API.xml" by default)'
+ )
+ parser.add_argument(
+ "--hmi_api_file",
+ type=str, default="HMI_API.xml",
+ help='Enter hmi api file name! ("HMI_API.xml" by default)'
+ )
+ parser.add_argument(
+ "-o", "--output",
+ type=str, default="console",
+ choices=['xml', 'json', 'console'],
+ help='Choose report type! ("console" by default)'
+ )
+ parser.add_argument(
+ "--full_info",
+ action="store_true",
+ help='Enter this parameter to get full detailed info!'
+ )
+ args = parser.parse_args()
+ return args
+
+
+def json_to_xml(json_obj, line_padding=" "):
+ """Function which converts json to xml format"""
+ result_list = list()
+ json_obj_type = type(json_obj)
+ if json_obj_type is list:
+ for sub_elem in json_obj:
+ result_list.append(json_to_xml(sub_elem, line_padding))
+ return "\n".join(result_list)
+ if json_obj_type is dict:
+ for tag_name in json_obj:
+ sub_obj = json_obj[tag_name]
+ result_list.append("%s<%s>" % (line_padding, tag_name))
+ result_list.append(json_to_xml(sub_obj, "\t" + line_padding))
+ result_list.append("%s</%s>" % (line_padding, tag_name))
+ return "\n".join(result_list)
+ return "%s%s" % (line_padding, json_obj)
+
+
+def dict_to_json(summary_result):
+ """Function converts python dictionary to json format"""
+ return json.dumps(
+ summary_result, sort_keys=True, indent=4, separators=(',', ': '))
+
+
+def set_build_status(comparison_result):
+ """Function sets up build status depend on comparison result"""
+ if len(comparison_result) > 0:
+ sys.exit(errno.EPERM)
+ else:
+ return
+
+
+def get_rpc_params(function):
+ """Function which gets all params from specified RPC"""
+ params = {}
+ for function_tag in function: # loop over function tags
+ if function_tag.tag == 'param':
+ name = function_tag.attrib['name']
+ params[name] = function_tag.attrib
+ return params
+
+
+Rpc = namedtuple("rpc", ["rpc_name", "rpc_type"])
+
+
+def extract_functions(interface, functions):
+ """Function extracting rpcs from passed interface"""
+ for child in interface:
+ if child.tag == 'function':
+ rpc_name = child.attrib['name']
+ rpc_type = child.attrib['messagetype']
+ key = Rpc(rpc_name=rpc_name, rpc_type=rpc_type)
+ params = get_rpc_params(child)
+ if key in functions:
+ functions[key].update(params)
+ else:
+ functions[key] = params
+
+
+def filter_params(rpc, params_to_filter, filter):
+ "Function filters rpc parameters according passed filter"
+ filtered = []
+ for param in params_to_filter:
+ # Filter only keys which present in filter
+ if param not in filter:
+ filtered.append(param)
+ else:
+ filter_func = filter[param]
+ if filter_func(rpc):
+ filtered.append(param)
+ return filtered
+
+
+def create_result_section(param, result):
+ """Function creating appropriate section in result dictionary"""
+ if param not in result:
+ result[param] = {}
+ if "HMI_API" not in result[param]:
+ result[param]["HMI_API"] = {}
+ if "Mobile_API" not in result[param]:
+ result[param]["Mobile_API"] = {}
+ mob_api_result_section = result[param]["Mobile_API"]
+ hmi_api_result_section = result[param]["HMI_API"]
+ return mob_api_result_section, hmi_api_result_section
+
+
+def compare_params(param, mob_param_attrs, hmi_param_attrs):
+ """Function comparing mobile and hmi parameter attributes"""
+ result = {}
+ mob_param_attrs = dict(mob_param_attrs)
+ hmi_param_attrs = dict(hmi_param_attrs)
+ for compare_rule in global_compare_rules:
+ condition = compare_rule[0]
+ rule = compare_rule[1]
+ if (condition(mob_param_attrs, hmi_param_attrs)):
+ mobile_res, hmi_res = rule(
+ mob_param_attrs, hmi_param_attrs)
+ if len(mobile_res) > 0 or len(hmi_res) > 0:
+ m_res, h_res = create_result_section(param, result)
+ m_res.update(mobile_res)
+ h_res.update(hmi_res)
+ return result
+
+
+def fill_summary_result(rpc_name, area, value, summary_result):
+ """Function filling summary comparison result"""
+ if rpc_name not in summary_result:
+ summary_result[rpc_name] = {}
+ rpc = summary_result[rpc_name]
+ if type(value) is not dict:
+ rpc[area] = value
+ elif type(value) is dict:
+ if area not in rpc:
+ rpc[area] = {}
+ rpc[area].update(value)
+
+
+def get_common_params(rpc_name, mob_api_functions, hmi_api_functions):
+ """Function calculates common parameters from mobile and hmi apis
+ for specified rpc
+ """
+ hmi_params = hmi_api_functions[rpc_name]
+ mob_params = mob_api_functions[rpc_name]
+ mob_keys = mob_params.keys()
+ hmi_keys = hmi_params.keys()
+ return list(set(mob_keys).intersection(set(hmi_keys)))
+
+
+def get_diff(common_params, rpc_name, hmi_params, mob_params, summary_result):
+ """Function which gets difference between parameters
+ and writes to summary result
+ """
+ for param in common_params:
+ mob_items = sorted(mob_params[param].items())
+ hmi_items = sorted(hmi_params[param].items())
+ diff_res = compare_params(param, mob_items, hmi_items)
+ area = "Attributes difference:"
+ if len(diff_res) > 0:
+ fill_summary_result(rpc_name, area,
+ diff_res, summary_result
+ )
+
+
+def print_parameters(common_params, hmi_params, mob_params):
+ """Function which prints parameters in mobile, hmi api
+ and common parameters
+ """
+ print "Parameters to check: ", common_params, "\n"
+ for param in common_params:
+ mob_items = sorted(mob_params[param].items())
+ hmi_items = sorted(hmi_params[param].items())
+ print colors.UNDERLINE + colors.BOLD + param + colors.ENDC, ":"
+ print "In Mobile API :\t", dict(mob_items)
+ print "In HMI API :\t", dict(hmi_items)
+
+
+def print_full_info(hmi_absent_params, hmi_params,
+ mob_absent_params, mob_params, rpc_name):
+ """Function prints full detailed info about every rpc"""
+ print "\n" + "---" * 60 + "\n"
+ rpc_color = colors.BOLD + colors.HEADER
+ print rpc_color + rpc_name + colors.ENDC
+ print colors.BOLD + "\nMobile API: " + colors.ENDC
+ print "Parameters quantity: ", len(mob_params)
+ print "Parameters list: ", sorted(mob_params.keys())
+ print colors.BOLD + "HMI API: " + colors.ENDC
+ print "Parameters quantity: ", len(hmi_params)
+ print "Parameters list: ", sorted(hmi_params.keys())
+ print "\n"
+ print("{}Parameters absent in Mobile APIs: {}{}".
+ format(colors.WARN, mob_absent_params, colors.ENDC))
+ print("{}Parameters absent in HMI APIs: {}{}".
+ format(colors.WARN, hmi_absent_params, colors.ENDC))
+ print "\n"
+
+
+def console_print(summary_result):
+ """Function which prints summary result to console"""
+ for rpc_name in sorted(summary_result.keys()):
+ print "\n" + "---" * 60
+ print colors.HEADER + rpc_name + colors.ENDC
+ for problematic_item in summary_result[rpc_name]:
+ item = summary_result[rpc_name][problematic_item]
+ if len(item) > 0:
+ print colors.UNDERLINE + problematic_item + colors.ENDC
+ if type(item) is not dict:
+ print("{}{}{}".format(colors.WARN, item, colors.ENDC))
+ elif type(item) is dict:
+ for param in item.keys():
+ item_print = colors.UNDERLINE + param + colors.ENDC
+ print "{} {}".format("Parameter name: ", item_print)
+ res_val = item[param]
+ for key in res_val:
+ print key, ":", colors.FAIL, res_val[key], colors.ENDC
+
+
+def print_summary_info(summary_result, args):
+ """Function which prints summary comparison info(if any).
+ Output type depends on command line args
+ """
+ summary_color = colors.UNDERLINE + colors.BOLD + colors.BLUE
+ print "\n"
+ print summary_color, "SUMMARY COMPARISON RESULT:\n", colors.ENDC
+ if len(summary_result) == 0:
+ print colors.BOLD + " === NO PROBLEMS FOUND ===" + colors.ENDC
+ return
+ if args.output == "console":
+ console_print(summary_result)
+ if args.output == "json":
+ json_summary_result = dict_to_json(summary_result)
+ print json_summary_result
+ if args.output == "xml":
+ json_summary_result = dict_to_json(summary_result)
+ temp = json.loads(json_summary_result)
+ xml_summary_result = json_to_xml(temp)
+ print xml_summary_result
+
+
+def handle_absent_params(area, absent_params, rpc_name, summary_result):
+ """Function which writes absent parameters(if any)
+ to summary result
+ """
+ if len(absent_params) > 0:
+ fill_summary_result(
+ rpc_name, area,
+ absent_params,
+ summary_result
+ )
+
+
+def get_absent_hmi_params(hmi_params, mob_params, rpc):
+ """Function caculates absent parameters in hmi api"""
+ hmi_absent_params = set(mob_params.keys()) - set(hmi_params.keys())
+ hmi_absent_params = filter_params(
+ rpc, hmi_absent_params, exclude_redundant_from_hmi_rpc_filter)
+ return hmi_absent_params
+
+
+def get_absent_mob_params(hmi_params, mob_params, rpc):
+ """Function caculates absent parameters in mobile api"""
+ mob_absent_params = set(hmi_params.keys()) - set(mob_params.keys())
+ mob_absent_params = filter_params(
+ rpc, mob_absent_params, exclude_params_from_mob_rpc)
+ return mob_absent_params
+
+
+def get_rpc_for_handle(rpc_name, hmi_params, mob_params):
+ """Function creates rpc with all parameters to check"""
+ rpc = type('', (), {})() # empty object
+ rpc.mobile_params = mob_params
+ rpc.hmi_params = hmi_params
+ rpc.rpc_name = rpc_name.rpc_name
+ rpc.rpc_type = rpc_name.rpc_type
+ return rpc
+
+
+def check_array_mandatory_param(attributes):
+ """Function checks presence of "array" mandatory parameters"""
+ result = {}
+ minsize_exists = "minsize" in attributes
+ if not minsize_exists:
+ attributes["minsize"] = None
+ result["array"] = attributes["array"]
+ result["minsize"] = attributes["minsize"]
+ maxsize_exists = "maxsize" in attributes
+ if not maxsize_exists:
+ attributes["maxsize"] = None
+ result["array"] = attributes["array"]
+ result["maxsize"] = attributes["maxsize"]
+ return result
+
+
+def array_compare_rule(mob_param_attributes, hmi_param_attributes):
+ """Function checks presence of necessary parameters
+ if "array"="true" field presents
+ """
+ attr = "array"
+ mobile_result = {}
+ if attr in mob_param_attributes and mob_param_attributes[attr] == "true":
+ mobile_result = check_array_mandatory_param(mob_param_attributes)
+ hmi_result = {}
+ if attr in hmi_param_attributes and hmi_param_attributes[attr] == "true":
+ hmi_result = check_array_mandatory_param(hmi_param_attributes)
+ return mobile_result, hmi_result
+
+
+def string_compare_rule(mob_param_attributes, hmi_param_attributes):
+ """Function checks presence of "minlength"="1" in HMI_API if
+ "minlength" is omitted in MobileAPI.
+ Should be checked only for "type"="String"
+ """
+ attr = "minlength"
+ if attr not in mob_param_attributes:
+ if attr not in hmi_param_attributes:
+ return {attr: None}, {attr: None}
+ elif hmi_param_attributes[attr] != "1":
+ return {attr: None}, {attr: hmi_param_attributes[attr]}
+ else:
+ mob_param_attributes[attr] = "1"
+ return {}, {}
+
+
+def all_compare_rule(mob_param_attributes, hmi_param_attributes):
+ """Function used for all common arrtibutes comparison"""
+ mobile_result = {}
+ hmi_result = {}
+ attr_names = mob_param_attributes.keys() + hmi_param_attributes.keys()
+ attr_names = set(attr_names)
+ for attr_name in attr_names:
+ mobile_attribute_value = None
+ hmi_attribute_value = None
+ compare_func = simple_values_comparison
+ if attr_name in attributes_comparison_rules:
+ # Get appropriate comparison function from attributes comparison
+ # rules
+ compare_func = attributes_comparison_rules[attr_name]
+ if attr_name in mob_param_attributes:
+ mobile_attribute_value = mob_param_attributes[attr_name]
+ if attr_name in hmi_param_attributes:
+ hmi_attribute_value = hmi_param_attributes[attr_name]
+ values_equal = compare_func(
+ mobile_attribute_value, hmi_attribute_value)
+ if not values_equal:
+ hmi_result[attr_name] = hmi_attribute_value
+ mobile_result[attr_name] = mobile_attribute_value
+ return mobile_result, hmi_result
+
+
+global_compare_rules = [
+ # Comparison rule when attribute "type" = "String"
+ (lambda mob_param_attributes, hmi_param_attributes:
+ mob_param_attributes["type"] == "String", string_compare_rule),
+ # Comparison rule when attribute "array" = "true"
+ (lambda mob_param_attributes, hmi_param_attributes:
+ 'array' in mob_param_attributes.keys() +
+ hmi_param_attributes.keys(), array_compare_rule),
+ # Common comparison function for all attributes
+ (lambda mob_param_attributes, hmi_param_attributes:
+ True, all_compare_rule)
+]
+
+attributes_comparison_rules = {
+ # If "mandatory" field is omitted i MobileApi
+ # it must be present in HMI_API as "mandatory"="true" by default
+ 'mandatory': lambda mobile_attribute_value, hmi_attribute_value:
+ True if mobile_attribute_value is None and hmi_attribute_value == "true"
+ else mobile_attribute_value == hmi_attribute_value,
+ # type <Common.<Struct/Enum> at HMI_API (MOBILE_APi has no <Common.>)
+ 'type': lambda mobile_attribute_value, hmi_attribute_value:
+ True if ("Common." + mobile_attribute_value) == hmi_attribute_value
+ else mobile_attribute_value == hmi_attribute_value
+}
+
+# Parameters in HMI_API which should be excluded from comparison
+exclude_redundant_from_hmi_rpc_filter = {
+ 'resultCode': lambda rpc: rpc.rpc_type != "response",
+ 'info': lambda rpc: rpc.rpc_type != "response",
+ 'success': lambda rpc: rpc.rpc_type != "response"
+}
+
+# Parameters in MOBILE_API which should be excluded from comparison
+exclude_params_from_mob_rpc = {
+ 'type': (lambda rpc: rpc.rpc_name not in ["AddCommand", "DeleteCommand"]),
+ 'appID': (lambda rpc: False),
+ 'grammarID': (lambda rpc: False)}
+
+
+def main():
+ args = parse_command_line_args()
+ mobile_api_tree = ElementTree.parse(args.mobile_api_file)
+ mob_api_functions = {}
+ extract_functions(mobile_api_tree.getroot(), mob_api_functions)
+
+ hmi_api_tree = ElementTree.parse(args.hmi_api_file)
+ hmi_api_functions = {}
+ for interface in hmi_api_tree.getroot():
+ extract_functions(interface, hmi_api_functions)
+ summary_result = {}
+ for rpc_name in sorted(mob_api_functions.keys()):
+ if rpc_name in hmi_api_functions:
+ hmi_params = hmi_api_functions[rpc_name]
+ mob_params = mob_api_functions[rpc_name]
+ rpc = get_rpc_for_handle(rpc_name, hmi_params, mob_params)
+ mob_absent_params = get_absent_mob_params(
+ hmi_params, mob_params, rpc)
+ hmi_absent_params = get_absent_hmi_params(
+ hmi_params, mob_params, rpc)
+ common_params = get_common_params(
+ rpc_name, mob_api_functions, hmi_api_functions)
+
+ rpc_name = str(rpc_name.rpc_name + " " + rpc_name.rpc_type)
+ if args.full_info:
+ print_full_info(hmi_absent_params, hmi_params,
+ mob_absent_params, mob_params, rpc_name)
+ print_parameters(common_params, hmi_params, mob_params)
+ handle_absent_params("Missed in Mobile APIs:", mob_absent_params,
+ rpc_name, summary_result)
+ handle_absent_params("Missed in HMI APIs:", hmi_absent_params,
+ rpc_name, summary_result)
+ get_diff(common_params, rpc_name, hmi_params,
+ mob_params, summary_result)
+ print_summary_info(summary_result, args)
+ set_build_status(summary_result)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/tools/infrastructure/check_style.sh b/tools/infrastructure/check_style.sh
index f42a048b34..647427e793 100755
--- a/tools/infrastructure/check_style.sh
+++ b/tools/infrastructure/check_style.sh
@@ -27,15 +27,31 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+FORMATER=clang-format-3.6
+INSTALL_CMD="sudo apt-get install -f $FORMATER"
+
+if [ "$1" = "--help" ]
+then
+ echo ""
+ echo "Script checks c++ code style in all .h .cc and .cpp files"
+ echo "Uses $FORMATER as base tool. Install it with : $INSTALL_CMD"
+ echo "Usage: `basename $0` [option]"
+ echo " --fix Fix files format indirectly"
+ echo " --help Display this information"
+ exit 0
+fi
+
+command -v $FORMATER >/dev/null 2>&1 || { echo >&2 "$FORMATER is not installed. Use following: $INSTALL_CMD"; exit 1; }
+
FILE_NAMES=$(find src -name \*.h -print -o -name \*.cpp -print -o -name \*.cc -print | grep -v 3rd_party)
check_style() {
- clang-format-3.6 -style=file $1 | diff $1 -
+ $FORMATER -style=file $1 | diff $1 -
}
fix_style() {
- clang-format-3.6 -style=file -i $1
+ $FORMATER -style=file -i $1
}
if [ "$1" = "--fix" ]
diff --git a/tools/infrastructure/show_disabled.sh b/tools/infrastructure/show_disabled.sh
new file mode 100755
index 0000000000..7444755017
--- /dev/null
+++ b/tools/infrastructure/show_disabled.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Variable to store total amount of disabled unit tests
+total_disabled=0
+
+echo ""
+echo "===== DISABLED Unit-tests amount ===== "
+echo ""
+
+# Getting the list of all UT executables
+for test_file in $(ctest -N | awk '{print $3}'); do
+ full_path=`find . -name $test_file -type f 2>/dev/null`
+ if [ $full_path ] ; then
+ # Count amount of disabled tests cases
+ count_of_disabled=$(${full_path} --gtest_list_tests | grep DISABLED | wc -l)
+ if [ 0 != $count_of_disabled ] ; then
+ let "total_disabled = $total_disabled + $count_of_disabled"
+ echo $count_of_disabled " : " $test_file;
+ fi
+ fi
+done
+echo ""
+echo "TOTAL AMOUNT OF DISABLED TESTS : " $total_disabled;
+
+exit 0
+
+
diff --git a/tools/intergen/GenerateInterfaceLibrary.cmake b/tools/intergen/GenerateInterfaceLibrary.cmake
index 8482a8206a..bec35e1e3a 100644
--- a/tools/intergen/GenerateInterfaceLibrary.cmake
+++ b/tools/intergen/GenerateInterfaceLibrary.cmake
@@ -51,6 +51,7 @@ function (GenerateInterfaceLibrary xml_file_name generated_interface_names)
${GENERATED_LIB_HEADER_DEPENDENCIES}
)
add_library(${interface_name} ${SOURCES})
+ add_dependencies(${interface_name} intergen)
# |previous_interface| ensures that interface libraries are built in the same order
# as they defined in |generated_interface_names|
diff --git a/tools/intergen/test/CMakeLists.txt b/tools/intergen/test/CMakeLists.txt
index f8af75c3bf..27d506443e 100644
--- a/tools/intergen/test/CMakeLists.txt
+++ b/tools/intergen/test/CMakeLists.txt
@@ -76,10 +76,10 @@ if (${HMI_DBUS_API})
${CMAKE_SOURCE_DIR}/src/components/dbus/include
${DBUS_INCLUDE_DIRS}
)
- set (LIBRARIES ${LIBRARIES} DBus)
+ set (LIBRARIES ${LIBRARIES} dbus)
set (SOURCES ${SOURCES} generated_interface_dbus_tests.cc)
endif ()
create_test(test_generated_interface "${SOURCES}" "${LIBRARIES}")
-endif() \ No newline at end of file
+endif()
diff --git a/tools/policy_table_validator/CMakeLists.txt b/tools/policy_table_validator/CMakeLists.txt
index 7d9194e473..eabe4cfd5c 100644
--- a/tools/policy_table_validator/CMakeLists.txt
+++ b/tools/policy_table_validator/CMakeLists.txt
@@ -1,12 +1,17 @@
#set( CMAKE_VERBOSE_MAKEFILE on )
include_directories(
- ${CMAKE_SOURCE_DIR}/src/components/policy/include
${CMAKE_SOURCE_DIR}/src/components/rpc_base/include/
${CMAKE_SOURCE_DIR}/src/components/utils/include/
${JSONCPP_INCLUDE_DIRECTORY}
)
+message(STATUS "Using ${EXTENDED_POLICY} policy mode")
+if (${EXTENDED_POLICY} STREQUAL "EXTERNAL_PROPRIETARY")
+ include_directories(${CMAKE_SOURCE_DIR}/src/components/policy/policy_external/include/)
+else()
+ include_directories(${CMAKE_SOURCE_DIR}/src/components/policy/policy_regular/include/)
+endif()
link_directories (
${CMAKE_BINARY_DIR}/src/components/rpc_base/
diff --git a/tools/policy_table_validator/main.cpp b/tools/policy_table_validator/main.cpp
index 509182edbf..99a4b7d7f9 100644
--- a/tools/policy_table_validator/main.cpp
+++ b/tools/policy_table_validator/main.cpp
@@ -15,7 +15,8 @@ enum ResultCode {
PT_TYPE_ERROR
};
-rpc::policy_table_interface_base::PolicyTableType StringToPolicyTableType(const std::string& str_pt_type) {
+rpc::policy_table_interface_base::PolicyTableType StringToPolicyTableType(
+ const std::string& str_pt_type) {
if (str_pt_type == "PT_PRELOADED") {
return rpc::policy_table_interface_base::PT_PRELOADED;
}
@@ -29,10 +30,11 @@ rpc::policy_table_interface_base::PolicyTableType StringToPolicyTableType(const
}
void help() {
- std::cout << "Usage:" << std::endl <<
- "./policy_validator {Policy table type} {file_name}" << std::endl;
+ std::cout << "Usage:" << std::endl
+ << "./policy_validator {Policy table type} {file_name}"
+ << std::endl;
std::cout << "Policy table types:"
- "\t PT_PRELOADED , PT_UPDATE , PT_SNAPSHOT" <<std::endl;
+ "\t PT_PRELOADED , PT_UPDATE , PT_SNAPSHOT" << std::endl;
}
int main(int argc, char** argv) {
@@ -46,8 +48,8 @@ int main(int argc, char** argv) {
std::string json_string;
rpc::policy_table_interface_base::PolicyTableType pt_type;
pt_type = StringToPolicyTableType(pt_type_str);
- if (rpc::policy_table_interface_base::PolicyTableType::INVALID_PT_TYPE
- == pt_type) {
+ if (rpc::policy_table_interface_base::PolicyTableType::INVALID_PT_TYPE ==
+ pt_type) {
std::cout << "Invalid policy table type: " << pt_type_str << std::endl;
exit(PT_TYPE_ERROR);
}
@@ -69,7 +71,7 @@ int main(int argc, char** argv) {
policy_table::Table table(&value);
table.SetPolicyTableType(pt_type);
bool is_valid = table.is_valid();
- if (true == is_valid ) {
+ if (true == is_valid) {
std::cout << "Table is valid" << std::endl;
exit(SUCCES);
}
@@ -77,7 +79,8 @@ int main(int argc, char** argv) {
std::cout << "Table is not valid" << std::endl;
rpc::ValidationReport report("policy_table");
table.ReportErrors(&report);
- std::cout << "Errors: " << std::endl << rpc::PrettyFormat(report) << std::endl;
+ std::cout << "Errors: " << std::endl
+ << rpc::PrettyFormat(report) << std::endl;
return SUCCES;
}